﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
using Helpers;
using TaleWorlds.CampaignSystem.Actions;
using TaleWorlds.CampaignSystem.CharacterDevelopment;
using TaleWorlds.CampaignSystem.Extensions;
using TaleWorlds.CampaignSystem.Issues;
using TaleWorlds.CampaignSystem.LogEntries;
using TaleWorlds.CampaignSystem.Map;
using TaleWorlds.CampaignSystem.Party;
using TaleWorlds.CampaignSystem.Party.PartyComponents;
using TaleWorlds.CampaignSystem.Settlements;
using TaleWorlds.CampaignSystem.Settlements.Workshops;
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.Localization;
using TaleWorlds.ObjectSystem;
using TaleWorlds.SaveSystem;
using TaleWorlds.SaveSystem.Load;

namespace TaleWorlds.CampaignSystem
{
	// Token: 0x0200005D RID: 93
	public sealed class Hero : MBObjectBase, ITrackableCampaignObject, ITrackableBase, IRandomOwner
	{
		// Token: 0x06000B49 RID: 2889 RVA: 0x0003D614 File Offset: 0x0003B814
		internal static void AutoGeneratedStaticCollectObjectsHero(object o, List<object> collectedObjects)
		{
			((Hero)o).AutoGeneratedInstanceCollectObjects(collectedObjects);
		}

		// Token: 0x06000B4A RID: 2890 RVA: 0x0003D624 File Offset: 0x0003B824
		protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
		{
			base.AutoGeneratedInstanceCollectObjects(collectedObjects);
			collectedObjects.Add(this.VolunteerTypes);
			collectedObjects.Add(this.Culture);
			collectedObjects.Add(this.SpecialItems);
			collectedObjects.Add(this._characterObject);
			collectedObjects.Add(this._firstName);
			collectedObjects.Add(this._name);
			collectedObjects.Add(this._heroTraits);
			collectedObjects.Add(this._heroPerks);
			collectedObjects.Add(this._heroSkills);
			collectedObjects.Add(this._characterAttributes);
			collectedObjects.Add(this._companionOf);
			CampaignTime.AutoGeneratedStaticCollectObjectsCampaignTime(this._birthDay, collectedObjects);
			CampaignTime.AutoGeneratedStaticCollectObjectsCampaignTime(this._deathDay, collectedObjects);
			collectedObjects.Add(this._clan);
			collectedObjects.Add(this._supporterOf);
			collectedObjects.Add(this._governorOf);
			collectedObjects.Add(this._ownedWorkshops);
			collectedObjects.Add(this._partyBelongedTo);
			collectedObjects.Add(this._stayingInSettlement);
			collectedObjects.Add(this._bornSettlement);
			collectedObjects.Add(this._father);
			collectedObjects.Add(this._mother);
			collectedObjects.Add(this._exSpouses);
			collectedObjects.Add(this._spouse);
			collectedObjects.Add(this._children);
			collectedObjects.Add(this._heroDeveloper);
			StaticBodyProperties.AutoGeneratedStaticCollectObjectsStaticBodyProperties(this.StaticBodyProperties, collectedObjects);
			collectedObjects.Add(this.EncyclopediaText);
			collectedObjects.Add(this._battleEquipment);
			collectedObjects.Add(this._civilianEquipment);
			CampaignTime.AutoGeneratedStaticCollectObjectsCampaignTime(this.CaptivityStartTime, collectedObjects);
			collectedObjects.Add(this.DeathMarkKillerHero);
			collectedObjects.Add(this.LastKnownClosestSettlement);
			collectedObjects.Add(this.PartyBelongedToAsPrisoner);
			CampaignTime.AutoGeneratedStaticCollectObjectsCampaignTime(this.LastMeetingTimeWithPlayer, collectedObjects);
		}

		// Token: 0x06000B4B RID: 2891 RVA: 0x0003D7F5 File Offset: 0x0003B9F5
		internal static object AutoGeneratedGetMemberValueStaticBodyProperties(object o)
		{
			return ((Hero)o).StaticBodyProperties;
		}

		// Token: 0x06000B4C RID: 2892 RVA: 0x0003D807 File Offset: 0x0003BA07
		internal static object AutoGeneratedGetMemberValueWeight(object o)
		{
			return ((Hero)o).Weight;
		}

		// Token: 0x06000B4D RID: 2893 RVA: 0x0003D819 File Offset: 0x0003BA19
		internal static object AutoGeneratedGetMemberValueBuild(object o)
		{
			return ((Hero)o).Build;
		}

		// Token: 0x06000B4E RID: 2894 RVA: 0x0003D82B File Offset: 0x0003BA2B
		internal static object AutoGeneratedGetMemberValueEncyclopediaText(object o)
		{
			return ((Hero)o).EncyclopediaText;
		}

		// Token: 0x06000B4F RID: 2895 RVA: 0x0003D838 File Offset: 0x0003BA38
		internal static object AutoGeneratedGetMemberValueIsFemale(object o)
		{
			return ((Hero)o).IsFemale;
		}

		// Token: 0x06000B50 RID: 2896 RVA: 0x0003D84A File Offset: 0x0003BA4A
		internal static object AutoGeneratedGetMemberValue_battleEquipment(object o)
		{
			return ((Hero)o)._battleEquipment;
		}

		// Token: 0x06000B51 RID: 2897 RVA: 0x0003D857 File Offset: 0x0003BA57
		internal static object AutoGeneratedGetMemberValue_civilianEquipment(object o)
		{
			return ((Hero)o)._civilianEquipment;
		}

		// Token: 0x06000B52 RID: 2898 RVA: 0x0003D864 File Offset: 0x0003BA64
		internal static object AutoGeneratedGetMemberValueCaptivityStartTime(object o)
		{
			return ((Hero)o).CaptivityStartTime;
		}

		// Token: 0x06000B53 RID: 2899 RVA: 0x0003D876 File Offset: 0x0003BA76
		internal static object AutoGeneratedGetMemberValuePreferredUpgradeFormation(object o)
		{
			return ((Hero)o).PreferredUpgradeFormation;
		}

		// Token: 0x06000B54 RID: 2900 RVA: 0x0003D888 File Offset: 0x0003BA88
		internal static object AutoGeneratedGetMemberValueIsMinorFactionHero(object o)
		{
			return ((Hero)o).IsMinorFactionHero;
		}

		// Token: 0x06000B55 RID: 2901 RVA: 0x0003D89A File Offset: 0x0003BA9A
		internal static object AutoGeneratedGetMemberValueOccupation(object o)
		{
			return ((Hero)o).Occupation;
		}

		// Token: 0x06000B56 RID: 2902 RVA: 0x0003D8AC File Offset: 0x0003BAAC
		internal static object AutoGeneratedGetMemberValueDeathMark(object o)
		{
			return ((Hero)o).DeathMark;
		}

		// Token: 0x06000B57 RID: 2903 RVA: 0x0003D8BE File Offset: 0x0003BABE
		internal static object AutoGeneratedGetMemberValueDeathMarkKillerHero(object o)
		{
			return ((Hero)o).DeathMarkKillerHero;
		}

		// Token: 0x06000B58 RID: 2904 RVA: 0x0003D8CB File Offset: 0x0003BACB
		internal static object AutoGeneratedGetMemberValueLastKnownClosestSettlement(object o)
		{
			return ((Hero)o).LastKnownClosestSettlement;
		}

		// Token: 0x06000B59 RID: 2905 RVA: 0x0003D8D8 File Offset: 0x0003BAD8
		internal static object AutoGeneratedGetMemberValueLastExaminedLogEntryID(object o)
		{
			return ((Hero)o).LastExaminedLogEntryID;
		}

		// Token: 0x06000B5A RID: 2906 RVA: 0x0003D8EA File Offset: 0x0003BAEA
		internal static object AutoGeneratedGetMemberValuePartyBelongedToAsPrisoner(object o)
		{
			return ((Hero)o).PartyBelongedToAsPrisoner;
		}

		// Token: 0x06000B5B RID: 2907 RVA: 0x0003D8F7 File Offset: 0x0003BAF7
		internal static object AutoGeneratedGetMemberValueLastMeetingTimeWithPlayer(object o)
		{
			return ((Hero)o).LastMeetingTimeWithPlayer;
		}

		// Token: 0x06000B5C RID: 2908 RVA: 0x0003D909 File Offset: 0x0003BB09
		internal static object AutoGeneratedGetMemberValueRandomValue(object o)
		{
			return ((Hero)o).RandomValue;
		}

		// Token: 0x06000B5D RID: 2909 RVA: 0x0003D91B File Offset: 0x0003BB1B
		internal static object AutoGeneratedGetMemberValueLastTimeStampForActivity(object o)
		{
			return ((Hero)o).LastTimeStampForActivity;
		}

		// Token: 0x06000B5E RID: 2910 RVA: 0x0003D92D File Offset: 0x0003BB2D
		internal static object AutoGeneratedGetMemberValueVolunteerTypes(object o)
		{
			return ((Hero)o).VolunteerTypes;
		}

		// Token: 0x06000B5F RID: 2911 RVA: 0x0003D93A File Offset: 0x0003BB3A
		internal static object AutoGeneratedGetMemberValueHairTags(object o)
		{
			return ((Hero)o).HairTags;
		}

		// Token: 0x06000B60 RID: 2912 RVA: 0x0003D947 File Offset: 0x0003BB47
		internal static object AutoGeneratedGetMemberValueBeardTags(object o)
		{
			return ((Hero)o).BeardTags;
		}

		// Token: 0x06000B61 RID: 2913 RVA: 0x0003D954 File Offset: 0x0003BB54
		internal static object AutoGeneratedGetMemberValueTattooTags(object o)
		{
			return ((Hero)o).TattooTags;
		}

		// Token: 0x06000B62 RID: 2914 RVA: 0x0003D961 File Offset: 0x0003BB61
		internal static object AutoGeneratedGetMemberValueLevel(object o)
		{
			return ((Hero)o).Level;
		}

		// Token: 0x06000B63 RID: 2915 RVA: 0x0003D973 File Offset: 0x0003BB73
		internal static object AutoGeneratedGetMemberValueSpcDaysInLocation(object o)
		{
			return ((Hero)o).SpcDaysInLocation;
		}

		// Token: 0x06000B64 RID: 2916 RVA: 0x0003D985 File Offset: 0x0003BB85
		internal static object AutoGeneratedGetMemberValueCulture(object o)
		{
			return ((Hero)o).Culture;
		}

		// Token: 0x06000B65 RID: 2917 RVA: 0x0003D992 File Offset: 0x0003BB92
		internal static object AutoGeneratedGetMemberValueSpecialItems(object o)
		{
			return ((Hero)o).SpecialItems;
		}

		// Token: 0x06000B66 RID: 2918 RVA: 0x0003D99F File Offset: 0x0003BB9F
		internal static object AutoGeneratedGetMemberValueIsPregnant(object o)
		{
			return ((Hero)o).IsPregnant;
		}

		// Token: 0x06000B67 RID: 2919 RVA: 0x0003D9B1 File Offset: 0x0003BBB1
		internal static object AutoGeneratedGetMemberValue_passedTimeAtHomeSettlement(object o)
		{
			return ((Hero)o)._passedTimeAtHomeSettlement;
		}

		// Token: 0x06000B68 RID: 2920 RVA: 0x0003D9C3 File Offset: 0x0003BBC3
		internal static object AutoGeneratedGetMemberValue_characterObject(object o)
		{
			return ((Hero)o)._characterObject;
		}

		// Token: 0x06000B69 RID: 2921 RVA: 0x0003D9D0 File Offset: 0x0003BBD0
		internal static object AutoGeneratedGetMemberValue_firstName(object o)
		{
			return ((Hero)o)._firstName;
		}

		// Token: 0x06000B6A RID: 2922 RVA: 0x0003D9DD File Offset: 0x0003BBDD
		internal static object AutoGeneratedGetMemberValue_name(object o)
		{
			return ((Hero)o)._name;
		}

		// Token: 0x06000B6B RID: 2923 RVA: 0x0003D9EA File Offset: 0x0003BBEA
		internal static object AutoGeneratedGetMemberValue_heroState(object o)
		{
			return ((Hero)o)._heroState;
		}

		// Token: 0x06000B6C RID: 2924 RVA: 0x0003D9FC File Offset: 0x0003BBFC
		internal static object AutoGeneratedGetMemberValue_heroTraits(object o)
		{
			return ((Hero)o)._heroTraits;
		}

		// Token: 0x06000B6D RID: 2925 RVA: 0x0003DA09 File Offset: 0x0003BC09
		internal static object AutoGeneratedGetMemberValue_heroPerks(object o)
		{
			return ((Hero)o)._heroPerks;
		}

		// Token: 0x06000B6E RID: 2926 RVA: 0x0003DA16 File Offset: 0x0003BC16
		internal static object AutoGeneratedGetMemberValue_heroSkills(object o)
		{
			return ((Hero)o)._heroSkills;
		}

		// Token: 0x06000B6F RID: 2927 RVA: 0x0003DA23 File Offset: 0x0003BC23
		internal static object AutoGeneratedGetMemberValue_characterAttributes(object o)
		{
			return ((Hero)o)._characterAttributes;
		}

		// Token: 0x06000B70 RID: 2928 RVA: 0x0003DA30 File Offset: 0x0003BC30
		internal static object AutoGeneratedGetMemberValue_companionOf(object o)
		{
			return ((Hero)o)._companionOf;
		}

		// Token: 0x06000B71 RID: 2929 RVA: 0x0003DA3D File Offset: 0x0003BC3D
		internal static object AutoGeneratedGetMemberValue_health(object o)
		{
			return ((Hero)o)._health;
		}

		// Token: 0x06000B72 RID: 2930 RVA: 0x0003DA4F File Offset: 0x0003BC4F
		internal static object AutoGeneratedGetMemberValue_defaultAge(object o)
		{
			return ((Hero)o)._defaultAge;
		}

		// Token: 0x06000B73 RID: 2931 RVA: 0x0003DA61 File Offset: 0x0003BC61
		internal static object AutoGeneratedGetMemberValue_birthDay(object o)
		{
			return ((Hero)o)._birthDay;
		}

		// Token: 0x06000B74 RID: 2932 RVA: 0x0003DA73 File Offset: 0x0003BC73
		internal static object AutoGeneratedGetMemberValue_deathDay(object o)
		{
			return ((Hero)o)._deathDay;
		}

		// Token: 0x06000B75 RID: 2933 RVA: 0x0003DA85 File Offset: 0x0003BC85
		internal static object AutoGeneratedGetMemberValue_power(object o)
		{
			return ((Hero)o)._power;
		}

		// Token: 0x06000B76 RID: 2934 RVA: 0x0003DA97 File Offset: 0x0003BC97
		internal static object AutoGeneratedGetMemberValue_clan(object o)
		{
			return ((Hero)o)._clan;
		}

		// Token: 0x06000B77 RID: 2935 RVA: 0x0003DAA4 File Offset: 0x0003BCA4
		internal static object AutoGeneratedGetMemberValue_supporterOf(object o)
		{
			return ((Hero)o)._supporterOf;
		}

		// Token: 0x06000B78 RID: 2936 RVA: 0x0003DAB1 File Offset: 0x0003BCB1
		internal static object AutoGeneratedGetMemberValue_governorOf(object o)
		{
			return ((Hero)o)._governorOf;
		}

		// Token: 0x06000B79 RID: 2937 RVA: 0x0003DABE File Offset: 0x0003BCBE
		internal static object AutoGeneratedGetMemberValue_ownedWorkshops(object o)
		{
			return ((Hero)o)._ownedWorkshops;
		}

		// Token: 0x06000B7A RID: 2938 RVA: 0x0003DACB File Offset: 0x0003BCCB
		internal static object AutoGeneratedGetMemberValue_partyBelongedTo(object o)
		{
			return ((Hero)o)._partyBelongedTo;
		}

		// Token: 0x06000B7B RID: 2939 RVA: 0x0003DAD8 File Offset: 0x0003BCD8
		internal static object AutoGeneratedGetMemberValue_stayingInSettlement(object o)
		{
			return ((Hero)o)._stayingInSettlement;
		}

		// Token: 0x06000B7C RID: 2940 RVA: 0x0003DAE5 File Offset: 0x0003BCE5
		internal static object AutoGeneratedGetMemberValue_isKnownToPlayer(object o)
		{
			return ((Hero)o)._isKnownToPlayer;
		}

		// Token: 0x06000B7D RID: 2941 RVA: 0x0003DAF7 File Offset: 0x0003BCF7
		internal static object AutoGeneratedGetMemberValue_hasMet(object o)
		{
			return ((Hero)o)._hasMet;
		}

		// Token: 0x06000B7E RID: 2942 RVA: 0x0003DB09 File Offset: 0x0003BD09
		internal static object AutoGeneratedGetMemberValue_bornSettlement(object o)
		{
			return ((Hero)o)._bornSettlement;
		}

		// Token: 0x06000B7F RID: 2943 RVA: 0x0003DB16 File Offset: 0x0003BD16
		internal static object AutoGeneratedGetMemberValue_gold(object o)
		{
			return ((Hero)o)._gold;
		}

		// Token: 0x06000B80 RID: 2944 RVA: 0x0003DB28 File Offset: 0x0003BD28
		internal static object AutoGeneratedGetMemberValue_father(object o)
		{
			return ((Hero)o)._father;
		}

		// Token: 0x06000B81 RID: 2945 RVA: 0x0003DB35 File Offset: 0x0003BD35
		internal static object AutoGeneratedGetMemberValue_mother(object o)
		{
			return ((Hero)o)._mother;
		}

		// Token: 0x06000B82 RID: 2946 RVA: 0x0003DB42 File Offset: 0x0003BD42
		internal static object AutoGeneratedGetMemberValue_exSpouses(object o)
		{
			return ((Hero)o)._exSpouses;
		}

		// Token: 0x06000B83 RID: 2947 RVA: 0x0003DB4F File Offset: 0x0003BD4F
		internal static object AutoGeneratedGetMemberValue_spouse(object o)
		{
			return ((Hero)o)._spouse;
		}

		// Token: 0x06000B84 RID: 2948 RVA: 0x0003DB5C File Offset: 0x0003BD5C
		internal static object AutoGeneratedGetMemberValue_children(object o)
		{
			return ((Hero)o)._children;
		}

		// Token: 0x06000B85 RID: 2949 RVA: 0x0003DB69 File Offset: 0x0003BD69
		internal static object AutoGeneratedGetMemberValue_heroDeveloper(object o)
		{
			return ((Hero)o)._heroDeveloper;
		}

		// Token: 0x1700029B RID: 667
		// (get) Token: 0x06000B86 RID: 2950 RVA: 0x0003DB76 File Offset: 0x0003BD76
		// (set) Token: 0x06000B87 RID: 2951 RVA: 0x0003DB7E File Offset: 0x0003BD7E
		[SaveableProperty(100)]
		internal StaticBodyProperties StaticBodyProperties { get; set; }

		// Token: 0x1700029C RID: 668
		// (get) Token: 0x06000B88 RID: 2952 RVA: 0x0003DB87 File Offset: 0x0003BD87
		// (set) Token: 0x06000B89 RID: 2953 RVA: 0x0003DB8F File Offset: 0x0003BD8F
		[SaveableProperty(111)]
		public float Weight { get; set; }

		// Token: 0x1700029D RID: 669
		// (get) Token: 0x06000B8A RID: 2954 RVA: 0x0003DB98 File Offset: 0x0003BD98
		// (set) Token: 0x06000B8B RID: 2955 RVA: 0x0003DBA0 File Offset: 0x0003BDA0
		[SaveableProperty(112)]
		public float Build { get; set; }

		// Token: 0x1700029E RID: 670
		// (get) Token: 0x06000B8C RID: 2956 RVA: 0x0003DBA9 File Offset: 0x0003BDA9
		public BodyProperties BodyProperties
		{
			get
			{
				return new BodyProperties(new DynamicBodyProperties(this.Age, this.Weight, this.Build), this.StaticBodyProperties);
			}
		}

		// Token: 0x1700029F RID: 671
		// (get) Token: 0x06000B8D RID: 2957 RVA: 0x0003DBCD File Offset: 0x0003BDCD
		// (set) Token: 0x06000B8E RID: 2958 RVA: 0x0003DBD5 File Offset: 0x0003BDD5
		public float PassedTimeAtHomeSettlement
		{
			get
			{
				return this._passedTimeAtHomeSettlement;
			}
			set
			{
				this._passedTimeAtHomeSettlement = value;
			}
		}

		// Token: 0x170002A0 RID: 672
		// (get) Token: 0x06000B8F RID: 2959 RVA: 0x0003DBDE File Offset: 0x0003BDDE
		public bool CanHaveRecruits
		{
			get
			{
				return Campaign.Current.Models.VolunteerModel.CanHaveRecruits(this);
			}
		}

		// Token: 0x170002A1 RID: 673
		// (get) Token: 0x06000B90 RID: 2960 RVA: 0x0003DBF5 File Offset: 0x0003BDF5
		public CharacterObject CharacterObject
		{
			get
			{
				return this._characterObject;
			}
		}

		// Token: 0x06000B91 RID: 2961 RVA: 0x0003DBFD File Offset: 0x0003BDFD
		public void SetCharacterObject(CharacterObject characterObject)
		{
			this._characterObject = characterObject;
			this.SetInitialValuesFromCharacter(this._characterObject);
		}

		// Token: 0x170002A2 RID: 674
		// (get) Token: 0x06000B92 RID: 2962 RVA: 0x0003DC12 File Offset: 0x0003BE12
		public TextObject FirstName
		{
			get
			{
				return this._firstName;
			}
		}

		// Token: 0x170002A3 RID: 675
		// (get) Token: 0x06000B93 RID: 2963 RVA: 0x0003DC1A File Offset: 0x0003BE1A
		public TextObject Name
		{
			get
			{
				return this._name;
			}
		}

		// Token: 0x06000B94 RID: 2964 RVA: 0x0003DC22 File Offset: 0x0003BE22
		public void SetName(TextObject fullName, TextObject firstName)
		{
			this._name = fullName;
			this._firstName = firstName;
			if (this.PartyBelongedTo != null && this.PartyBelongedTo.LeaderHero == this)
			{
				this.PartyBelongedTo.PartyComponent.ClearCachedName();
			}
		}

		// Token: 0x170002A4 RID: 676
		// (get) Token: 0x06000B95 RID: 2965 RVA: 0x0003DC58 File Offset: 0x0003BE58
		// (set) Token: 0x06000B96 RID: 2966 RVA: 0x0003DC60 File Offset: 0x0003BE60
		[SaveableProperty(190)]
		public TextObject EncyclopediaText { get; set; }

		// Token: 0x170002A5 RID: 677
		// (get) Token: 0x06000B97 RID: 2967 RVA: 0x0003DC69 File Offset: 0x0003BE69
		public string EncyclopediaLink
		{
			get
			{
				return (Campaign.Current.EncyclopediaManager.GetIdentifier(typeof(Hero)) + "-" + base.StringId) ?? "";
			}
		}

		// Token: 0x170002A6 RID: 678
		// (get) Token: 0x06000B98 RID: 2968 RVA: 0x0003DC9D File Offset: 0x0003BE9D
		public TextObject EncyclopediaLinkWithName
		{
			get
			{
				return HyperlinkTexts.GetHeroHyperlinkText(this.EncyclopediaLink, this.Name);
			}
		}

		// Token: 0x170002A7 RID: 679
		// (get) Token: 0x06000B99 RID: 2969 RVA: 0x0003DCB0 File Offset: 0x0003BEB0
		// (set) Token: 0x06000B9A RID: 2970 RVA: 0x0003DCB8 File Offset: 0x0003BEB8
		[SaveableProperty(200)]
		public bool IsFemale { get; private set; }

		// Token: 0x06000B9B RID: 2971 RVA: 0x0003DCC1 File Offset: 0x0003BEC1
		public void UpdatePlayerGender(bool isFemale)
		{
			this.IsFemale = isFemale;
		}

		// Token: 0x170002A8 RID: 680
		// (get) Token: 0x06000B9C RID: 2972 RVA: 0x0003DCCA File Offset: 0x0003BECA
		// (set) Token: 0x06000B9D RID: 2973 RVA: 0x0003DCD2 File Offset: 0x0003BED2
		[SaveableProperty(210)]
		private Equipment _battleEquipment { get; set; }

		// Token: 0x170002A9 RID: 681
		// (get) Token: 0x06000B9E RID: 2974 RVA: 0x0003DCDB File Offset: 0x0003BEDB
		// (set) Token: 0x06000B9F RID: 2975 RVA: 0x0003DCE3 File Offset: 0x0003BEE3
		[SaveableProperty(220)]
		private Equipment _civilianEquipment { get; set; }

		// Token: 0x170002AA RID: 682
		// (get) Token: 0x06000BA0 RID: 2976 RVA: 0x0003DCEC File Offset: 0x0003BEEC
		public Equipment BattleEquipment
		{
			get
			{
				return this._battleEquipment ?? Campaign.Current.DeadBattleEquipment;
			}
		}

		// Token: 0x170002AB RID: 683
		// (get) Token: 0x06000BA1 RID: 2977 RVA: 0x0003DD02 File Offset: 0x0003BF02
		public Equipment CivilianEquipment
		{
			get
			{
				return this._civilianEquipment ?? Campaign.Current.DeadCivilianEquipment;
			}
		}

		// Token: 0x170002AC RID: 684
		// (get) Token: 0x06000BA2 RID: 2978 RVA: 0x0003DD18 File Offset: 0x0003BF18
		// (set) Token: 0x06000BA3 RID: 2979 RVA: 0x0003DD20 File Offset: 0x0003BF20
		[SaveableProperty(240)]
		public CampaignTime CaptivityStartTime { get; set; }

		// Token: 0x170002AD RID: 685
		// (get) Token: 0x06000BA4 RID: 2980 RVA: 0x0003DD29 File Offset: 0x0003BF29
		// (set) Token: 0x06000BA5 RID: 2981 RVA: 0x0003DD31 File Offset: 0x0003BF31
		[SaveableProperty(800)]
		public FormationClass PreferredUpgradeFormation { get; set; }

		// Token: 0x170002AE RID: 686
		// (get) Token: 0x06000BA6 RID: 2982 RVA: 0x0003DD3A File Offset: 0x0003BF3A
		// (set) Token: 0x06000BA7 RID: 2983 RVA: 0x0003DD42 File Offset: 0x0003BF42
		public Hero.CharacterStates HeroState
		{
			get
			{
				return this._heroState;
			}
			private set
			{
				this.ChangeState(value);
			}
		}

		// Token: 0x06000BA8 RID: 2984 RVA: 0x0003DD4B File Offset: 0x0003BF4B
		public CharacterTraits GetHeroTraits()
		{
			return this._heroTraits;
		}

		// Token: 0x170002AF RID: 687
		// (get) Token: 0x06000BA9 RID: 2985 RVA: 0x0003DD53 File Offset: 0x0003BF53
		// (set) Token: 0x06000BAA RID: 2986 RVA: 0x0003DD5B File Offset: 0x0003BF5B
		[SaveableProperty(320)]
		public bool IsMinorFactionHero { get; set; }

		// Token: 0x170002B0 RID: 688
		// (get) Token: 0x06000BAB RID: 2987 RVA: 0x0003DD64 File Offset: 0x0003BF64
		// (set) Token: 0x06000BAC RID: 2988 RVA: 0x0003DD6C File Offset: 0x0003BF6C
		public IssueBase Issue { get; private set; }

		// Token: 0x06000BAD RID: 2989 RVA: 0x0003DD75 File Offset: 0x0003BF75
		public void OnIssueCreatedForHero(IssueBase issue)
		{
			this.Issue = issue;
		}

		// Token: 0x06000BAE RID: 2990 RVA: 0x0003DD7E File Offset: 0x0003BF7E
		public void OnIssueDeactivatedForHero()
		{
			this.Issue = null;
		}

		// Token: 0x06000BAF RID: 2991 RVA: 0x0003DD87 File Offset: 0x0003BF87
		public override string ToString()
		{
			return this.Name.ToString();
		}

		// Token: 0x170002B1 RID: 689
		// (get) Token: 0x06000BB0 RID: 2992 RVA: 0x0003DD94 File Offset: 0x0003BF94
		public bool CanBeCompanion
		{
			get
			{
				return this.IsWanderer && this.CompanionOf == null;
			}
		}

		// Token: 0x170002B2 RID: 690
		// (get) Token: 0x06000BB1 RID: 2993 RVA: 0x0003DDAC File Offset: 0x0003BFAC
		public bool IsNoncombatant
		{
			get
			{
				return this.GetSkillValue(DefaultSkills.OneHanded) < 50 && this.GetSkillValue(DefaultSkills.TwoHanded) < 50 && this.GetSkillValue(DefaultSkills.Polearm) < 50 && this.GetSkillValue(DefaultSkills.Throwing) < 50 && this.GetSkillValue(DefaultSkills.Crossbow) < 50 && this.GetSkillValue(DefaultSkills.Bow) < 50;
			}
		}

		// Token: 0x170002B3 RID: 691
		// (get) Token: 0x06000BB2 RID: 2994 RVA: 0x0003DE15 File Offset: 0x0003C015
		// (set) Token: 0x06000BB3 RID: 2995 RVA: 0x0003DE20 File Offset: 0x0003C020
		public Clan CompanionOf
		{
			get
			{
				return this._companionOf;
			}
			set
			{
				if (value == this._companionOf)
				{
					return;
				}
				this._homeSettlement = null;
				if (this._companionOf != null)
				{
					this._companionOf.OnCompanionRemoved(this);
				}
				this._companionOf = value;
				if (this._companionOf != null)
				{
					this._companionOf.OnCompanionAdded(this);
				}
			}
		}

		// Token: 0x170002B4 RID: 692
		// (get) Token: 0x06000BB4 RID: 2996 RVA: 0x0003DE6D File Offset: 0x0003C06D
		public IEnumerable<Hero> CompanionsInParty
		{
			get
			{
				if (this.PartyBelongedTo != null && this.Clan != null)
				{
					foreach (Hero hero in this.Clan.Companions)
					{
						if (hero.PartyBelongedTo == this.PartyBelongedTo)
						{
							yield return hero;
						}
					}
					List<Hero>.Enumerator enumerator = default(List<Hero>.Enumerator);
				}
				yield break;
				yield break;
			}
		}

		// Token: 0x170002B5 RID: 693
		// (get) Token: 0x06000BB5 RID: 2997 RVA: 0x0003DE7D File Offset: 0x0003C07D
		// (set) Token: 0x06000BB6 RID: 2998 RVA: 0x0003DE85 File Offset: 0x0003C085
		[SaveableProperty(780)]
		public Occupation Occupation { get; private set; }

		// Token: 0x170002B6 RID: 694
		// (get) Token: 0x06000BB7 RID: 2999 RVA: 0x0003DE8E File Offset: 0x0003C08E
		public CharacterObject Template
		{
			get
			{
				return this.CharacterObject.OriginalCharacter;
			}
		}

		// Token: 0x170002B7 RID: 695
		// (get) Token: 0x06000BB8 RID: 3000 RVA: 0x0003DE9B File Offset: 0x0003C09B
		public bool IsDead
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Dead;
			}
		}

		// Token: 0x170002B8 RID: 696
		// (get) Token: 0x06000BB9 RID: 3001 RVA: 0x0003DEA6 File Offset: 0x0003C0A6
		public bool IsFugitive
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Fugitive;
			}
		}

		// Token: 0x170002B9 RID: 697
		// (get) Token: 0x06000BBA RID: 3002 RVA: 0x0003DEB1 File Offset: 0x0003C0B1
		public bool IsPrisoner
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Prisoner;
			}
		}

		// Token: 0x170002BA RID: 698
		// (get) Token: 0x06000BBB RID: 3003 RVA: 0x0003DEBC File Offset: 0x0003C0BC
		public bool IsReleased
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Released;
			}
		}

		// Token: 0x170002BB RID: 699
		// (get) Token: 0x06000BBC RID: 3004 RVA: 0x0003DEC7 File Offset: 0x0003C0C7
		public bool IsActive
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Active;
			}
		}

		// Token: 0x170002BC RID: 700
		// (get) Token: 0x06000BBD RID: 3005 RVA: 0x0003DED2 File Offset: 0x0003C0D2
		public bool IsNotSpawned
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.NotSpawned;
			}
		}

		// Token: 0x170002BD RID: 701
		// (get) Token: 0x06000BBE RID: 3006 RVA: 0x0003DEDD File Offset: 0x0003C0DD
		public bool IsDisabled
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Disabled;
			}
		}

		// Token: 0x170002BE RID: 702
		// (get) Token: 0x06000BBF RID: 3007 RVA: 0x0003DEE8 File Offset: 0x0003C0E8
		public bool IsTraveling
		{
			get
			{
				return this.HeroState == Hero.CharacterStates.Traveling;
			}
		}

		// Token: 0x170002BF RID: 703
		// (get) Token: 0x06000BC0 RID: 3008 RVA: 0x0003DEF3 File Offset: 0x0003C0F3
		public bool IsAlive
		{
			get
			{
				return !this.IsDead;
			}
		}

		// Token: 0x170002C0 RID: 704
		// (get) Token: 0x06000BC1 RID: 3009 RVA: 0x0003DEFE File Offset: 0x0003C0FE
		// (set) Token: 0x06000BC2 RID: 3010 RVA: 0x0003DF06 File Offset: 0x0003C106
		[SaveableProperty(400)]
		public KillCharacterAction.KillCharacterActionDetail DeathMark { get; private set; }

		// Token: 0x170002C1 RID: 705
		// (get) Token: 0x06000BC3 RID: 3011 RVA: 0x0003DF0F File Offset: 0x0003C10F
		// (set) Token: 0x06000BC4 RID: 3012 RVA: 0x0003DF17 File Offset: 0x0003C117
		[SaveableProperty(401)]
		public Hero DeathMarkKillerHero { get; private set; }

		// Token: 0x170002C2 RID: 706
		// (get) Token: 0x06000BC5 RID: 3013 RVA: 0x0003DF20 File Offset: 0x0003C120
		// (set) Token: 0x06000BC6 RID: 3014 RVA: 0x0003DF28 File Offset: 0x0003C128
		[SaveableProperty(411)]
		public Settlement LastKnownClosestSettlement { get; private set; }

		// Token: 0x06000BC7 RID: 3015 RVA: 0x0003DF31 File Offset: 0x0003C131
		public void UpdateLastKnownClosestSettlement(Settlement settlement)
		{
			this.LastKnownClosestSettlement = settlement;
		}

		// Token: 0x06000BC8 RID: 3016 RVA: 0x0003DF3C File Offset: 0x0003C13C
		public void SetNewOccupation(Occupation occupation)
		{
			Occupation occupation2 = this.Occupation;
			this.Occupation = occupation;
			CampaignEventDispatcher.Instance.OnHeroOccupationChanged(this, occupation2);
		}

		// Token: 0x170002C3 RID: 707
		// (get) Token: 0x06000BC9 RID: 3017 RVA: 0x0003DF63 File Offset: 0x0003C163
		public bool IsWanderer
		{
			get
			{
				return this.Occupation == Occupation.Wanderer;
			}
		}

		// Token: 0x170002C4 RID: 708
		// (get) Token: 0x06000BCA RID: 3018 RVA: 0x0003DF6F File Offset: 0x0003C16F
		public bool IsTemplate
		{
			get
			{
				return this.CharacterObject.IsTemplate;
			}
		}

		// Token: 0x170002C5 RID: 709
		// (get) Token: 0x06000BCB RID: 3019 RVA: 0x0003DF7C File Offset: 0x0003C17C
		public bool IsWounded
		{
			get
			{
				return this.HitPoints <= 20;
			}
		}

		// Token: 0x170002C6 RID: 710
		// (get) Token: 0x06000BCC RID: 3020 RVA: 0x0003DF8B File Offset: 0x0003C18B
		public bool IsPlayerCompanion
		{
			get
			{
				return this.CompanionOf == Clan.PlayerClan;
			}
		}

		// Token: 0x170002C7 RID: 711
		// (get) Token: 0x06000BCD RID: 3021 RVA: 0x0003DF9A File Offset: 0x0003C19A
		public bool IsMerchant
		{
			get
			{
				return this.Occupation == Occupation.Merchant;
			}
		}

		// Token: 0x170002C8 RID: 712
		// (get) Token: 0x06000BCE RID: 3022 RVA: 0x0003DFA6 File Offset: 0x0003C1A6
		public bool IsPreacher
		{
			get
			{
				return this.Occupation == Occupation.Preacher;
			}
		}

		// Token: 0x170002C9 RID: 713
		// (get) Token: 0x06000BCF RID: 3023 RVA: 0x0003DFB2 File Offset: 0x0003C1B2
		public bool IsHeadman
		{
			get
			{
				return this.Occupation == Occupation.Headman;
			}
		}

		// Token: 0x170002CA RID: 714
		// (get) Token: 0x06000BD0 RID: 3024 RVA: 0x0003DFBE File Offset: 0x0003C1BE
		public bool IsGangLeader
		{
			get
			{
				return this.Occupation == Occupation.GangLeader;
			}
		}

		// Token: 0x170002CB RID: 715
		// (get) Token: 0x06000BD1 RID: 3025 RVA: 0x0003DFCA File Offset: 0x0003C1CA
		public bool IsArtisan
		{
			get
			{
				return this.Occupation == Occupation.Artisan;
			}
		}

		// Token: 0x170002CC RID: 716
		// (get) Token: 0x06000BD2 RID: 3026 RVA: 0x0003DFD6 File Offset: 0x0003C1D6
		public bool IsRuralNotable
		{
			get
			{
				return this.Occupation == Occupation.RuralNotable;
			}
		}

		// Token: 0x170002CD RID: 717
		// (get) Token: 0x06000BD3 RID: 3027 RVA: 0x0003DFE2 File Offset: 0x0003C1E2
		public bool IsUrbanNotable
		{
			get
			{
				return this.Occupation == Occupation.Merchant || this.Occupation == Occupation.Artisan || this.Occupation == Occupation.GangLeader;
			}
		}

		// Token: 0x170002CE RID: 718
		// (get) Token: 0x06000BD4 RID: 3028 RVA: 0x0003E004 File Offset: 0x0003C204
		public bool IsSpecial
		{
			get
			{
				return this.Occupation == Occupation.Special;
			}
		}

		// Token: 0x170002CF RID: 719
		// (get) Token: 0x06000BD5 RID: 3029 RVA: 0x0003E010 File Offset: 0x0003C210
		public bool IsRebel
		{
			get
			{
				return this.Clan != null && this.Clan.IsRebelClan;
			}
		}

		// Token: 0x170002D0 RID: 720
		// (get) Token: 0x06000BD6 RID: 3030 RVA: 0x0003E027 File Offset: 0x0003C227
		public bool IsCommander
		{
			get
			{
				return this.GetTraitLevel(DefaultTraits.Commander) > 0;
			}
		}

		// Token: 0x170002D1 RID: 721
		// (get) Token: 0x06000BD7 RID: 3031 RVA: 0x0003E037 File Offset: 0x0003C237
		public bool IsPartyLeader
		{
			get
			{
				return this.PartyBelongedTo != null && this.PartyBelongedTo.LeaderHero == this;
			}
		}

		// Token: 0x170002D2 RID: 722
		// (get) Token: 0x06000BD8 RID: 3032 RVA: 0x0003E051 File Offset: 0x0003C251
		public bool IsNotable
		{
			get
			{
				return this.IsArtisan || this.IsGangLeader || this.IsPreacher || this.IsMerchant || this.IsRuralNotable || this.IsHeadman;
			}
		}

		// Token: 0x170002D3 RID: 723
		// (get) Token: 0x06000BD9 RID: 3033 RVA: 0x0003E083 File Offset: 0x0003C283
		public bool IsLord
		{
			get
			{
				return this.Occupation == Occupation.Lord;
			}
		}

		// Token: 0x170002D4 RID: 724
		// (get) Token: 0x06000BDA RID: 3034 RVA: 0x0003E08E File Offset: 0x0003C28E
		public int MaxHitPoints
		{
			get
			{
				return this.CharacterObject.MaxHitPoints();
			}
		}

		// Token: 0x170002D5 RID: 725
		// (get) Token: 0x06000BDB RID: 3035 RVA: 0x0003E09B File Offset: 0x0003C29B
		// (set) Token: 0x06000BDC RID: 3036 RVA: 0x0003E0A4 File Offset: 0x0003C2A4
		public int HitPoints
		{
			get
			{
				return this._health;
			}
			set
			{
				if (this._health == value)
				{
					return;
				}
				int health = this._health;
				this._health = value;
				if (this._health < 0)
				{
					this._health = 1;
				}
				else if (this._health > this.CharacterObject.MaxHitPoints())
				{
					this._health = this.CharacterObject.MaxHitPoints();
				}
				if (health <= 20 != this._health <= 20)
				{
					if (this.PartyBelongedTo != null)
					{
						this.PartyBelongedTo.MemberRoster.OnHeroHealthStatusChanged(this);
					}
					if (this.PartyBelongedToAsPrisoner != null)
					{
						this.PartyBelongedToAsPrisoner.PrisonRoster.OnHeroHealthStatusChanged(this);
					}
				}
				if (health > 20 && this.IsWounded)
				{
					CampaignEventDispatcher.Instance.OnHeroWounded(this);
				}
			}
		}

		// Token: 0x170002D6 RID: 726
		// (get) Token: 0x06000BDD RID: 3037 RVA: 0x0003E15E File Offset: 0x0003C35E
		public CampaignTime BirthDay
		{
			get
			{
				if (CampaignOptions.IsLifeDeathCycleDisabled)
				{
					return CampaignTime.YearsFromNow(-this._defaultAge);
				}
				return this._birthDay;
			}
		}

		// Token: 0x170002D7 RID: 727
		// (get) Token: 0x06000BDE RID: 3038 RVA: 0x0003E17A File Offset: 0x0003C37A
		// (set) Token: 0x06000BDF RID: 3039 RVA: 0x0003E1A6 File Offset: 0x0003C3A6
		public CampaignTime DeathDay
		{
			get
			{
				if (CampaignOptions.IsLifeDeathCycleDisabled)
				{
					return CampaignTime.YearsFromNow(-this._defaultAge) + CampaignTime.Years(this._defaultAge);
				}
				return this._deathDay;
			}
			set
			{
				this._deathDay = value;
			}
		}

		// Token: 0x170002D8 RID: 728
		// (get) Token: 0x06000BE0 RID: 3040 RVA: 0x0003E1B0 File Offset: 0x0003C3B0
		public float Age
		{
			get
			{
				if (CampaignOptions.IsLifeDeathCycleDisabled)
				{
					return this._defaultAge;
				}
				if (this.IsAlive)
				{
					return this._birthDay.ElapsedYearsUntilNow;
				}
				return (float)(this.DeathDay - this._birthDay).ToYears;
			}
		}

		// Token: 0x06000BE1 RID: 3041 RVA: 0x0003E1F9 File Offset: 0x0003C3F9
		public void SetBirthDay(CampaignTime birthday)
		{
			this._birthDay = birthday;
			this._defaultAge = (birthday.IsNow ? 0.001f : this._birthDay.ElapsedYearsUntilNow);
		}

		// Token: 0x170002D9 RID: 729
		// (get) Token: 0x06000BE2 RID: 3042 RVA: 0x0003E223 File Offset: 0x0003C423
		public bool IsChild
		{
			get
			{
				return this.Age < (float)Campaign.Current.Models.AgeModel.HeroComesOfAge;
			}
		}

		// Token: 0x170002DA RID: 730
		// (get) Token: 0x06000BE3 RID: 3043 RVA: 0x0003E242 File Offset: 0x0003C442
		public float Power
		{
			get
			{
				return this._power;
			}
		}

		// Token: 0x06000BE4 RID: 3044 RVA: 0x0003E24A File Offset: 0x0003C44A
		public void AddPower(float value)
		{
			this._power += value;
		}

		// Token: 0x170002DB RID: 731
		// (get) Token: 0x06000BE5 RID: 3045 RVA: 0x0003E25A File Offset: 0x0003C45A
		public Banner ClanBanner
		{
			get
			{
				Clan clan = this.Clan;
				if (clan == null)
				{
					return null;
				}
				return clan.Banner;
			}
		}

		// Token: 0x170002DC RID: 732
		// (get) Token: 0x06000BE6 RID: 3046 RVA: 0x0003E26D File Offset: 0x0003C46D
		// (set) Token: 0x06000BE7 RID: 3047 RVA: 0x0003E275 File Offset: 0x0003C475
		[SaveableProperty(481)]
		public long LastExaminedLogEntryID { get; set; }

		// Token: 0x170002DD RID: 733
		// (get) Token: 0x06000BE8 RID: 3048 RVA: 0x0003E27E File Offset: 0x0003C47E
		// (set) Token: 0x06000BE9 RID: 3049 RVA: 0x0003E290 File Offset: 0x0003C490
		public Clan Clan
		{
			get
			{
				return this.CompanionOf ?? this._clan;
			}
			set
			{
				if (this._clan != value)
				{
					this._homeSettlement = null;
					if (this._clan != null)
					{
						this._clan.OnLordRemoved(this);
					}
					Clan clan = this._clan;
					this._clan = value;
					if (this._clan != null)
					{
						this._clan.OnLordAdded(this);
					}
					CampaignEventDispatcher.Instance.OnHeroChangedClan(this, clan);
				}
			}
		}

		// Token: 0x170002DE RID: 734
		// (get) Token: 0x06000BEA RID: 3050 RVA: 0x0003E2EF File Offset: 0x0003C4EF
		// (set) Token: 0x06000BEB RID: 3051 RVA: 0x0003E2F7 File Offset: 0x0003C4F7
		public Clan SupporterOf
		{
			get
			{
				return this._supporterOf;
			}
			set
			{
				if (this._supporterOf != value)
				{
					if (this._supporterOf != null)
					{
						this._supporterOf.OnSupporterNotableRemoved(this);
					}
					this._supporterOf = value;
					if (this._supporterOf != null)
					{
						this._supporterOf.OnSupporterNotableAdded(this);
					}
				}
			}
		}

		// Token: 0x170002DF RID: 735
		// (get) Token: 0x06000BEC RID: 3052 RVA: 0x0003E331 File Offset: 0x0003C531
		// (set) Token: 0x06000BED RID: 3053 RVA: 0x0003E339 File Offset: 0x0003C539
		public Town GovernorOf
		{
			get
			{
				return this._governorOf;
			}
			set
			{
				if (value != this._governorOf)
				{
					this._governorOf = value;
				}
			}
		}

		// Token: 0x170002E0 RID: 736
		// (get) Token: 0x06000BEE RID: 3054 RVA: 0x0003E34C File Offset: 0x0003C54C
		public IFaction MapFaction
		{
			get
			{
				if (this.Clan != null)
				{
					IFaction kingdom = this.Clan.Kingdom;
					return kingdom ?? this.Clan;
				}
				if (this.IsSpecial)
				{
					return null;
				}
				if (this.HomeSettlement != null)
				{
					return this.HomeSettlement.MapFaction;
				}
				if (this.PartyBelongedTo != null)
				{
					return this.PartyBelongedTo.MapFaction;
				}
				return null;
			}
		}

		// Token: 0x170002E1 RID: 737
		// (get) Token: 0x06000BEF RID: 3055 RVA: 0x0003E3AC File Offset: 0x0003C5AC
		// (set) Token: 0x06000BF0 RID: 3056 RVA: 0x0003E3B4 File Offset: 0x0003C5B4
		public List<Alley> OwnedAlleys { get; private set; }

		// Token: 0x170002E2 RID: 738
		// (get) Token: 0x06000BF1 RID: 3057 RVA: 0x0003E3BD File Offset: 0x0003C5BD
		public bool IsFactionLeader
		{
			get
			{
				return this.MapFaction != null && this.MapFaction.Leader == this;
			}
		}

		// Token: 0x170002E3 RID: 739
		// (get) Token: 0x06000BF2 RID: 3058 RVA: 0x0003E3D7 File Offset: 0x0003C5D7
		public bool IsKingdomLeader
		{
			get
			{
				return this.MapFaction != null && this.MapFaction.IsKingdomFaction && this.MapFaction.Leader == this;
			}
		}

		// Token: 0x170002E4 RID: 740
		// (get) Token: 0x06000BF3 RID: 3059 RVA: 0x0003E3FE File Offset: 0x0003C5FE
		public bool IsClanLeader
		{
			get
			{
				return this.Clan != null && this.Clan.Leader == this;
			}
		}

		// Token: 0x170002E5 RID: 741
		// (get) Token: 0x06000BF4 RID: 3060 RVA: 0x0003E418 File Offset: 0x0003C618
		// (set) Token: 0x06000BF5 RID: 3061 RVA: 0x0003E420 File Offset: 0x0003C620
		public List<CaravanPartyComponent> OwnedCaravans { get; private set; }

		// Token: 0x170002E6 RID: 742
		// (get) Token: 0x06000BF6 RID: 3062 RVA: 0x0003E429 File Offset: 0x0003C629
		// (set) Token: 0x06000BF7 RID: 3063 RVA: 0x0003E431 File Offset: 0x0003C631
		public MobileParty PartyBelongedTo
		{
			get
			{
				return this._partyBelongedTo;
			}
			private set
			{
				this.SetPartyBelongedTo(value);
			}
		}

		// Token: 0x170002E7 RID: 743
		// (get) Token: 0x06000BF8 RID: 3064 RVA: 0x0003E43A File Offset: 0x0003C63A
		// (set) Token: 0x06000BF9 RID: 3065 RVA: 0x0003E442 File Offset: 0x0003C642
		[SaveableProperty(570)]
		public PartyBase PartyBelongedToAsPrisoner { get; private set; }

		// Token: 0x170002E8 RID: 744
		// (get) Token: 0x06000BFA RID: 3066 RVA: 0x0003E44B File Offset: 0x0003C64B
		// (set) Token: 0x06000BFB RID: 3067 RVA: 0x0003E453 File Offset: 0x0003C653
		public Settlement StayingInSettlement
		{
			get
			{
				return this._stayingInSettlement;
			}
			set
			{
				if (this._stayingInSettlement != value)
				{
					if (this._stayingInSettlement != null)
					{
						this._stayingInSettlement.RemoveHeroWithoutParty(this);
						this._stayingInSettlement = null;
					}
					if (value != null)
					{
						value.AddHeroWithoutParty(this);
					}
					this._stayingInSettlement = value;
				}
			}
		}

		// Token: 0x170002E9 RID: 745
		// (get) Token: 0x06000BFC RID: 3068 RVA: 0x0003E48A File Offset: 0x0003C68A
		public bool IsHumanPlayerCharacter
		{
			get
			{
				return this == Hero.MainHero;
			}
		}

		// Token: 0x170002EA RID: 746
		// (get) Token: 0x06000BFD RID: 3069 RVA: 0x0003E494 File Offset: 0x0003C694
		// (set) Token: 0x06000BFE RID: 3070 RVA: 0x0003E49C File Offset: 0x0003C69C
		public bool IsKnownToPlayer
		{
			get
			{
				return this._isKnownToPlayer;
			}
			set
			{
				if (this._isKnownToPlayer != value)
				{
					this._isKnownToPlayer = value;
					CampaignEventDispatcher.Instance.OnPlayerLearnsAboutHero(this);
				}
			}
		}

		// Token: 0x170002EB RID: 747
		// (get) Token: 0x06000BFF RID: 3071 RVA: 0x0003E4B9 File Offset: 0x0003C6B9
		// (set) Token: 0x06000C00 RID: 3072 RVA: 0x0003E4C1 File Offset: 0x0003C6C1
		public bool HasMet
		{
			get
			{
				return this._hasMet;
			}
			private set
			{
				if (this._hasMet != value)
				{
					this._hasMet = value;
					CampaignEventDispatcher.Instance.OnPlayerMetHero(this);
				}
			}
		}

		// Token: 0x06000C01 RID: 3073 RVA: 0x0003E4DE File Offset: 0x0003C6DE
		public void SetHasMet()
		{
			this.HasMet = true;
			this.LastMeetingTimeWithPlayer = CampaignTime.Now;
		}

		// Token: 0x170002EC RID: 748
		// (get) Token: 0x06000C02 RID: 3074 RVA: 0x0003E4F2 File Offset: 0x0003C6F2
		// (set) Token: 0x06000C03 RID: 3075 RVA: 0x0003E4FA File Offset: 0x0003C6FA
		[SaveableProperty(620)]
		public CampaignTime LastMeetingTimeWithPlayer { get; set; }

		// Token: 0x170002ED RID: 749
		// (get) Token: 0x06000C04 RID: 3076 RVA: 0x0003E503 File Offset: 0x0003C703
		// (set) Token: 0x06000C05 RID: 3077 RVA: 0x0003E50B File Offset: 0x0003C70B
		public Settlement BornSettlement
		{
			get
			{
				return this._bornSettlement;
			}
			set
			{
				this._bornSettlement = value;
				this._homeSettlement = null;
			}
		}

		// Token: 0x170002EE RID: 750
		// (get) Token: 0x06000C06 RID: 3078 RVA: 0x0003E51B File Offset: 0x0003C71B
		public Settlement HomeSettlement
		{
			get
			{
				if (this._homeSettlement == null)
				{
					this.UpdateHomeSettlement();
				}
				return this._homeSettlement;
			}
		}

		// Token: 0x06000C07 RID: 3079 RVA: 0x0003E534 File Offset: 0x0003C734
		public void UpdateHomeSettlement()
		{
			if (this.GovernorOf != null)
			{
				this._homeSettlement = this.GovernorOf.Owner.Settlement;
				return;
			}
			if (this.Spouse != null && this.Spouse.GovernorOf != null)
			{
				this._homeSettlement = this.Spouse.GovernorOf.Owner.Settlement;
				return;
			}
			foreach (Hero hero in this.Children)
			{
				if (hero.GovernorOf != null && hero.Clan == this.Clan)
				{
					this._homeSettlement = hero.GovernorOf.Owner.Settlement;
					return;
				}
			}
			if (this.Father != null && this.Father.GovernorOf != null && this.Father.Clan == this.Clan)
			{
				this._homeSettlement = this.Father.GovernorOf.Owner.Settlement;
				return;
			}
			if (this.Mother != null && this.Mother.GovernorOf != null && this.Mother.Clan == this.Clan)
			{
				this._homeSettlement = this.Mother.GovernorOf.Owner.Settlement;
				return;
			}
			foreach (Hero hero2 in this.Siblings)
			{
				if (hero2.GovernorOf != null && hero2.Clan == this.Clan)
				{
					this._homeSettlement = hero2.GovernorOf.Owner.Settlement;
					return;
				}
			}
			if (this.Clan != null)
			{
				this._homeSettlement = this.Clan.HomeSettlement;
				return;
			}
			if (this.CompanionOf != null)
			{
				this._homeSettlement = this.CompanionOf.HomeSettlement;
				return;
			}
			if (this.IsNotable && this.CurrentSettlement != null)
			{
				this._homeSettlement = this.CurrentSettlement;
				return;
			}
			this._homeSettlement = this._bornSettlement;
		}

		// Token: 0x170002EF RID: 751
		// (get) Token: 0x06000C08 RID: 3080 RVA: 0x0003E74C File Offset: 0x0003C94C
		public Settlement CurrentSettlement
		{
			get
			{
				Settlement result = null;
				if (this.PartyBelongedTo != null)
				{
					result = this.PartyBelongedTo.CurrentSettlement;
				}
				else if (this.PartyBelongedToAsPrisoner != null)
				{
					result = (this.PartyBelongedToAsPrisoner.IsSettlement ? this.PartyBelongedToAsPrisoner.Settlement : (this.PartyBelongedToAsPrisoner.IsMobile ? this.PartyBelongedToAsPrisoner.MobileParty.CurrentSettlement : null));
				}
				else if (this.StayingInSettlement != null)
				{
					result = this.StayingInSettlement;
				}
				return result;
			}
		}

		// Token: 0x170002F0 RID: 752
		// (get) Token: 0x06000C09 RID: 3081 RVA: 0x0003E7C6 File Offset: 0x0003C9C6
		// (set) Token: 0x06000C0A RID: 3082 RVA: 0x0003E7CE File Offset: 0x0003C9CE
		public int Gold
		{
			get
			{
				return this._gold;
			}
			set
			{
				this._gold = MathF.Max(0, value);
			}
		}

		// Token: 0x170002F1 RID: 753
		// (get) Token: 0x06000C0B RID: 3083 RVA: 0x0003E7DD File Offset: 0x0003C9DD
		// (set) Token: 0x06000C0C RID: 3084 RVA: 0x0003E7E5 File Offset: 0x0003C9E5
		[SaveableProperty(660)]
		public int RandomValue { get; private set; } = MBRandom.RandomInt(1, int.MaxValue);

		// Token: 0x170002F2 RID: 754
		// (get) Token: 0x06000C0D RID: 3085 RVA: 0x0003E7EE File Offset: 0x0003C9EE
		// (set) Token: 0x06000C0E RID: 3086 RVA: 0x0003E7FC File Offset: 0x0003C9FC
		public EquipmentElement BannerItem
		{
			get
			{
				return this.BattleEquipment[EquipmentIndex.ExtraWeaponSlot];
			}
			set
			{
				this.BattleEquipment[EquipmentIndex.ExtraWeaponSlot] = value;
			}
		}

		// Token: 0x170002F3 RID: 755
		// (get) Token: 0x06000C0F RID: 3087 RVA: 0x0003E80B File Offset: 0x0003CA0B
		public float ProbabilityOfDeath
		{
			get
			{
				return Campaign.Current.Models.HeroDeathProbabilityCalculationModel.CalculateHeroDeathProbability(this);
			}
		}

		// Token: 0x170002F4 RID: 756
		// (get) Token: 0x06000C10 RID: 3088 RVA: 0x0003E822 File Offset: 0x0003CA22
		// (set) Token: 0x06000C11 RID: 3089 RVA: 0x0003E82A File Offset: 0x0003CA2A
		public Hero Father
		{
			get
			{
				return this._father;
			}
			set
			{
				this._father = value;
				if (this._father != null)
				{
					this._father._children.Add(this);
				}
			}
		}

		// Token: 0x170002F5 RID: 757
		// (get) Token: 0x06000C12 RID: 3090 RVA: 0x0003E84C File Offset: 0x0003CA4C
		// (set) Token: 0x06000C13 RID: 3091 RVA: 0x0003E854 File Offset: 0x0003CA54
		public Hero Mother
		{
			get
			{
				return this._mother;
			}
			set
			{
				this._mother = value;
				if (this._mother != null)
				{
					this._mother._children.Add(this);
				}
			}
		}

		// Token: 0x170002F6 RID: 758
		// (get) Token: 0x06000C14 RID: 3092 RVA: 0x0003E876 File Offset: 0x0003CA76
		public MBReadOnlyList<Hero> ExSpouses
		{
			get
			{
				return this._exSpouses;
			}
		}

		// Token: 0x170002F7 RID: 759
		// (get) Token: 0x06000C15 RID: 3093 RVA: 0x0003E87E File Offset: 0x0003CA7E
		// (set) Token: 0x06000C16 RID: 3094 RVA: 0x0003E888 File Offset: 0x0003CA88
		public Hero Spouse
		{
			get
			{
				return this._spouse;
			}
			set
			{
				if (this._spouse != value)
				{
					Hero spouse = this._spouse;
					this._spouse = value;
					if (spouse != null)
					{
						this._exSpouses.Add(spouse);
						spouse.Spouse = null;
					}
					if (this._spouse != null)
					{
						this._spouse.Spouse = this;
					}
				}
			}
		}

		// Token: 0x170002F8 RID: 760
		// (get) Token: 0x06000C17 RID: 3095 RVA: 0x0003E8D6 File Offset: 0x0003CAD6
		public MBList<Hero> Children
		{
			get
			{
				return this._children;
			}
		}

		// Token: 0x170002F9 RID: 761
		// (get) Token: 0x06000C18 RID: 3096 RVA: 0x0003E8DE File Offset: 0x0003CADE
		public IEnumerable<Hero> Siblings
		{
			get
			{
				if (this.Father != null)
				{
					foreach (Hero hero in this.Father._children)
					{
						if (hero != this)
						{
							yield return hero;
						}
					}
					List<Hero>.Enumerator enumerator = default(List<Hero>.Enumerator);
				}
				else if (this.Mother != null)
				{
					foreach (Hero hero2 in this.Mother._children)
					{
						if (hero2 != this)
						{
							yield return hero2;
						}
					}
					List<Hero>.Enumerator enumerator = default(List<Hero>.Enumerator);
				}
				yield break;
				yield break;
			}
		}

		// Token: 0x170002FA RID: 762
		// (get) Token: 0x06000C19 RID: 3097 RVA: 0x0003E8EE File Offset: 0x0003CAEE
		public IHeroDeveloper HeroDeveloper
		{
			get
			{
				return this._heroDeveloper;
			}
		}

		// Token: 0x06000C1A RID: 3098 RVA: 0x0003E8F6 File Offset: 0x0003CAF6
		public int GetSkillValue(SkillObject skill)
		{
			if (this._heroSkills == null)
			{
				return 0;
			}
			return this._heroSkills.GetPropertyValue(skill);
		}

		// Token: 0x06000C1B RID: 3099 RVA: 0x0003E90E File Offset: 0x0003CB0E
		public void SetSkillValue(SkillObject skill, int value)
		{
			this._heroSkills.SetPropertyValue(skill, value);
		}

		// Token: 0x06000C1C RID: 3100 RVA: 0x0003E91D File Offset: 0x0003CB1D
		public void ClearSkills()
		{
			this._heroSkills.ClearAllProperty();
		}

		// Token: 0x06000C1D RID: 3101 RVA: 0x0003E92A File Offset: 0x0003CB2A
		public void AddSkillXp(SkillObject skill, float xpAmount)
		{
			IHeroDeveloper heroDeveloper = this._heroDeveloper;
			if (heroDeveloper == null)
			{
				return;
			}
			heroDeveloper.AddSkillXp(skill, xpAmount, true, true);
		}

		// Token: 0x06000C1E RID: 3102 RVA: 0x0003E940 File Offset: 0x0003CB40
		public int GetAttributeValue(CharacterAttribute charAttribute)
		{
			if (this._characterAttributes == null)
			{
				return 0;
			}
			return this._characterAttributes.GetPropertyValue(charAttribute);
		}

		// Token: 0x06000C1F RID: 3103 RVA: 0x0003E958 File Offset: 0x0003CB58
		internal void SetAttributeValueInternal(CharacterAttribute charAttribute, int value)
		{
			int value2 = MBMath.ClampInt(value, 0, Campaign.Current.Models.CharacterDevelopmentModel.MaxAttribute);
			this._characterAttributes.SetPropertyValue(charAttribute, value2);
		}

		// Token: 0x06000C20 RID: 3104 RVA: 0x0003E98E File Offset: 0x0003CB8E
		public void ClearAttributes()
		{
			CharacterAttributes characterAttributes = this._characterAttributes;
			if (characterAttributes == null)
			{
				return;
			}
			characterAttributes.ClearAllProperty();
		}

		// Token: 0x06000C21 RID: 3105 RVA: 0x0003E9A0 File Offset: 0x0003CBA0
		public void SetTraitLevel(TraitObject trait, int value)
		{
			value = MBMath.ClampInt(value, trait.MinValue, trait.MaxValue);
			this._heroTraits.SetPropertyValue(trait, value);
		}

		// Token: 0x06000C22 RID: 3106 RVA: 0x0003E9C3 File Offset: 0x0003CBC3
		public int GetTraitLevel(TraitObject trait)
		{
			if (this._heroTraits == null)
			{
				return 0;
			}
			return this._heroTraits.GetPropertyValue(trait);
		}

		// Token: 0x06000C23 RID: 3107 RVA: 0x0003E9DB File Offset: 0x0003CBDB
		public void ClearTraits()
		{
			this._heroTraits.ClearAllProperty();
		}

		// Token: 0x06000C24 RID: 3108 RVA: 0x0003E9E8 File Offset: 0x0003CBE8
		internal void SetPerkValueInternal(PerkObject perk, bool value)
		{
			this._heroPerks.SetPropertyValue(perk, value ? 1 : 0);
			if (value)
			{
				CampaignEventDispatcher.Instance.OnPerkOpened(this, perk);
			}
		}

		// Token: 0x06000C25 RID: 3109 RVA: 0x0003EA0C File Offset: 0x0003CC0C
		public bool GetPerkValue(PerkObject perk)
		{
			return this._heroPerks != null && this._heroPerks.GetPropertyValue(perk) != 0;
		}

		// Token: 0x06000C26 RID: 3110 RVA: 0x0003EA27 File Offset: 0x0003CC27
		public void ClearPerks()
		{
			this._heroPerks.ClearAllProperty();
			this.HitPoints = MathF.Min(this.HitPoints, this.MaxHitPoints);
		}

		// Token: 0x06000C27 RID: 3111 RVA: 0x0003EA4C File Offset: 0x0003CC4C
		public static Hero CreateHero(string stringID)
		{
			stringID = Campaign.Current.CampaignObjectManager.FindNextUniqueStringId<Hero>(stringID);
			Hero hero = new Hero(stringID);
			Campaign.Current.CampaignObjectManager.AddHero(hero);
			return hero;
		}

		// Token: 0x06000C28 RID: 3112 RVA: 0x0003EA84 File Offset: 0x0003CC84
		public Hero(string stringID)
		{
			base.StringId = stringID;
			this._heroDeveloper = new HeroDeveloper(this);
			this._exSpouses = new MBList<Hero>();
			this.Init();
		}

		// Token: 0x06000C29 RID: 3113 RVA: 0x0003EB04 File Offset: 0x0003CD04
		public Hero()
		{
			this._heroDeveloper = new HeroDeveloper(this);
			this._exSpouses = new MBList<Hero>();
			this.Init();
		}

		// Token: 0x06000C2A RID: 3114 RVA: 0x0003EB7C File Offset: 0x0003CD7C
		public void Init()
		{
			this._battleEquipment = null;
			this._civilianEquipment = null;
			this._gold = 0;
			this.OwnedCaravans = new List<CaravanPartyComponent>();
			this.OwnedAlleys = new List<Alley>();
			this.SpecialItems = new MBList<ItemObject>();
			this._health = 1;
			this._deathDay = CampaignTime.Never;
			this.HeroState = Hero.CharacterStates.NotSpawned;
			this._heroSkills = new CharacterSkills();
			this._heroTraits = new CharacterTraits();
			this._heroPerks = new CharacterPerks();
			this._characterAttributes = new CharacterAttributes();
			this.VolunteerTypes = new CharacterObject[6];
		}

		// Token: 0x06000C2B RID: 3115 RVA: 0x0003EC10 File Offset: 0x0003CE10
		[LoadInitializationCallback]
		private void OnLoad(MetaData metaData, ObjectLoadData objectLoadData)
		{
			this.OwnedCaravans = new List<CaravanPartyComponent>();
			this.OwnedAlleys = new List<Alley>();
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("e1.7.3.0", 54620))
			{
				this.PreferredUpgradeFormation = FormationClass.NumberOfAllFormations;
			}
			if (this._firstName == null)
			{
				this._firstName = this.Name;
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("e1.8.0.0", 54620))
			{
				object memberValueBySaveId;
				bool flag;
				bool flag2;
				if ((memberValueBySaveId = objectLoadData.GetMemberValueBySaveId(310)) is bool)
				{
					flag = (bool)memberValueBySaveId;
					flag2 = true;
				}
				else
				{
					flag2 = false;
				}
				this.IsNobleForOldSaves = (flag2 && flag);
			}
		}

		// Token: 0x06000C2C RID: 3116 RVA: 0x0003ECBC File Offset: 0x0003CEBC
		[LateLoadInitializationCallback]
		private void OnAfterLoad(MetaData metaData)
		{
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion.IsOlderThan(ApplicationVersion.FromString("v1.2.8.31599", 54620)) && !this.CharacterObject.IsTemplate && !this.CharacterObject.HiddenInEncylopedia && this.PartyBelongedTo != null && this.PartyBelongedTo.LeaderHero != this && (this.CharacterObject.Occupation == Occupation.Soldier || this.CharacterObject.Occupation == Occupation.Mercenary || this.CharacterObject.Occupation == Occupation.Bandit || this.CharacterObject.Occupation == Occupation.Gangster || this.CharacterObject.Occupation == Occupation.CaravanGuard || (this.CharacterObject.Occupation == Occupation.Villager && this.CharacterObject.UpgradeTargets.Length != 0)))
			{
				this.PartyBelongedTo.MemberRoster.AddToCounts(this.CharacterObject, -this.PartyBelongedTo.MemberRoster.GetTroopCount(this.CharacterObject), false, 0, 0, true, -1);
			}
		}

		// Token: 0x06000C2D RID: 3117 RVA: 0x0003EDC8 File Offset: 0x0003CFC8
		protected override void PreAfterLoad()
		{
			if (!this._characterObject.IsObsolete)
			{
				Clan supporterOf = this._supporterOf;
				if (supporterOf != null)
				{
					supporterOf.OnSupporterNotableAdded(this);
				}
				if (this._companionOf != null)
				{
					this._companionOf.OnCompanionAdded(this);
				}
				else if (this._clan != null && this._clan.StringId != "neutral" && this.Occupation == Occupation.Lord)
				{
					this._clan.OnLordAdded(this);
				}
				if (this.CurrentSettlement != null && this.PartyBelongedTo == null && this.PartyBelongedToAsPrisoner == null)
				{
					this.CurrentSettlement.AddHeroWithoutParty(this);
				}
			}
			if (MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.1.0", 54620) && this.FirstName != null && this.Name != null && this != Hero.MainHero)
			{
				if (this.Name.Attributes == null || !this.Name.Attributes.ContainsKey("FIRSTNAME"))
				{
					this.Name.SetTextVariable("FIRSTNAME", this.FirstName);
				}
				if (this.Name.Attributes == null || !this.Name.Attributes.ContainsKey("FEMALE"))
				{
					this.Name.SetTextVariable("FEMALE", this.IsFemale ? 1 : 0);
				}
			}
		}

		// Token: 0x06000C2E RID: 3118 RVA: 0x0003EF20 File Offset: 0x0003D120
		protected override void AfterLoad()
		{
			CharacterPerks heroPerks = this._heroPerks;
			if (heroPerks != null)
			{
				heroPerks.ClearChangedPerks(this);
			}
			IHeroDeveloper heroDeveloper = this.HeroDeveloper;
			if (heroDeveloper != null)
			{
				heroDeveloper.AfterLoad();
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion.IsOlderThan(ApplicationVersion.FromString("v1.2.9.35637", 54620)) && this.GovernorOf != null && (this.PartyBelongedTo != null || this.PartyBelongedToAsPrisoner != null))
			{
				ChangeGovernorAction.RemoveGovernorOf(this);
			}
			if (MBSaveLoad.LastLoadedGameVersion.IsOlderThan(ApplicationVersion.FromString("v1.2.8.31599", 54620)))
			{
				if (this != Hero.MainHero && this.IsPrisoner && this != Hero.MainHero && this.IsPrisoner && this.PartyBelongedToAsPrisoner == null && this.CurrentSettlement != null)
				{
					this.PartyBelongedToAsPrisoner = this.CurrentSettlement.Party;
				}
				MobileParty mainParty = MobileParty.MainParty;
				if (this != Hero.MainHero && this.PartyBelongedTo == mainParty && !mainParty.MemberRoster.Contains(this.CharacterObject))
				{
					MakeHeroFugitiveAction.Apply(this);
				}
				if (mainParty.MemberRoster.Contains(this.CharacterObject) && this.PartyBelongedTo != mainParty)
				{
					mainParty.MemberRoster.RemoveTroop(this.CharacterObject, mainParty.MemberRoster.GetElementNumber(this.CharacterObject), default(UniqueTroopDescriptor), 0);
					if (!Campaign.Current.IssueManager.IssueSolvingCompanionList.Contains(this))
					{
						MobileParty partyBelongedTo = this.PartyBelongedTo;
						if (partyBelongedTo != null && !partyBelongedTo.IsCaravan)
						{
							MakeHeroFugitiveAction.Apply(this);
						}
					}
				}
				if (this.Spouse != null && (this.Spouse.Clan != this.Clan || this.Clan == null || this.Age < (float)Campaign.Current.Models.AgeModel.HeroComesOfAge))
				{
					Hero spouse = this.Spouse;
					this.Spouse = null;
					this._exSpouses.Remove(spouse);
					spouse._exSpouses.Remove(this);
					MBReadOnlyList<LogEntry> gameActionLogs = Campaign.Current.LogEntryHistory.GameActionLogs;
					for (int i = gameActionLogs.Count - 1; i >= 0; i--)
					{
						CharacterMarriedLogEntry characterMarriedLogEntry;
						if ((characterMarriedLogEntry = (gameActionLogs[i] as CharacterMarriedLogEntry)) != null && (characterMarriedLogEntry.IsVisibleInEncyclopediaPageOf<Hero>(this) || characterMarriedLogEntry.IsVisibleInEncyclopediaPageOf<Hero>(this)))
						{
							Campaign.Current.LogEntryHistory.DeleteLogAtIndex(i);
						}
					}
					Hero hero = this.Mother ?? this.Father;
					if (hero != null)
					{
						this.Clan = hero.Clan;
					}
					else if (this.Age < (float)Campaign.Current.Models.AgeModel.HeroComesOfAge && !this.IsDead)
					{
						KillCharacterAction.ApplyByRemove(this, false, true);
					}
					else
					{
						Clan clan = null;
						int num = int.MaxValue;
						for (int j = 0; j < Clan.All.Count<Clan>(); j++)
						{
							Clan clan2 = Clan.All[j];
							if (clan2 != Clan.PlayerClan && !clan2.IsBanditFaction && !clan2.IsRebelClan && !clan2.IsEliminated && this.Culture == clan2.Culture && clan2.Heroes.Count < num)
							{
								num = clan2.Heroes.Count;
								clan = clan2;
							}
						}
						if (clan == null)
						{
							clan = Clan.All.GetRandomElementWithPredicate((Clan currentClan) => currentClan != Clan.PlayerClan && !currentClan.IsBanditFaction && !currentClan.IsRebelClan && !currentClan.IsEliminated);
						}
						this.Clan = clan;
					}
				}
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.1.1", 54620) && !this.IsDead && this.CurrentSettlement == null && this.IsNotable && this.BornSettlement != null)
			{
				TeleportHeroAction.ApplyImmediateTeleportToSettlement(this, this.BornSettlement);
				if (!this.IsActive)
				{
					this.ChangeState(Hero.CharacterStates.Active);
				}
				this.UpdateHomeSettlement();
			}
			if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion.IsOlderThan(ApplicationVersion.FromString("v1.2.8.31599", 54620)) && (!this.CharacterObject.IsTemplate && !this.CharacterObject.HiddenInEncylopedia && (this.CharacterObject.Occupation == Occupation.Soldier || this.CharacterObject.Occupation == Occupation.Mercenary || this.CharacterObject.Occupation == Occupation.Bandit || this.CharacterObject.Occupation == Occupation.Gangster || this.CharacterObject.Occupation == Occupation.CaravanGuard || (this.CharacterObject.Occupation == Occupation.Villager && this.CharacterObject.UpgradeTargets.Length != 0))))
			{
				if (this.PartyBelongedTo != null)
				{
					if (this.PartyBelongedTo.LeaderHero == this)
					{
						DestroyPartyAction.Apply(null, this.PartyBelongedTo);
					}
					else
					{
						this.PartyBelongedTo.MemberRoster.AddToCounts(this.CharacterObject, -this.PartyBelongedTo.MemberRoster.GetTroopCount(this.CharacterObject), false, 0, 0, true, -1);
					}
				}
				if (this.PartyBelongedToAsPrisoner != null)
				{
					EndCaptivityAction.ApplyByDeath(this);
				}
				if (this.IsAlive)
				{
					KillCharacterAction.ApplyByRemove(this, false, true);
				}
				Campaign.Current.CampaignObjectManager.UnregisterDeadHero(this);
				Campaign.Current.ObjectManager.UnregisterObject(this.CharacterObject);
			}
		}

		// Token: 0x06000C2F RID: 3119 RVA: 0x0003F440 File Offset: 0x0003D640
		public void ChangeState(Hero.CharacterStates newState)
		{
			Hero.CharacterStates heroState = this._heroState;
			this._heroState = newState;
			Campaign.Current.CampaignObjectManager.HeroStateChanged(this, heroState);
		}

		// Token: 0x06000C30 RID: 3120 RVA: 0x0003F46C File Offset: 0x0003D66C
		public bool IsHealthFull()
		{
			return this.HitPoints >= this.CharacterObject.MaxHitPoints();
		}

		// Token: 0x06000C31 RID: 3121 RVA: 0x0003F484 File Offset: 0x0003D684
		private void HealByAmountInternal(int healingAmount, bool addXp = false)
		{
			if (!this.IsHealthFull())
			{
				int num = MathF.Min(healingAmount, this.CharacterObject.MaxHitPoints() - this.HitPoints);
				this.HitPoints += num;
				if (addXp)
				{
					SkillLevelingManager.OnHeroHealedWhileWaiting(this, num);
				}
			}
		}

		// Token: 0x06000C32 RID: 3122 RVA: 0x0003F4CC File Offset: 0x0003D6CC
		public void Heal(int healAmount, bool addXp = false)
		{
			int heroesEffectedHealingAmount = Campaign.Current.Models.PartyHealingModel.GetHeroesEffectedHealingAmount(this, (float)healAmount);
			this.HealByAmountInternal(heroesEffectedHealingAmount, addXp);
		}

		// Token: 0x06000C33 RID: 3123 RVA: 0x0003F4FC File Offset: 0x0003D6FC
		public override void Deserialize(MBObjectManager objectManager, XmlNode node)
		{
			base.Deserialize(objectManager, node);
			CharacterObject @object = MBObjectManager.Instance.GetObject<CharacterObject>(base.StringId);
			this.SetCharacterObject(@object);
			this.StaticBodyProperties = this.CharacterObject.GetBodyPropertiesMin(false).StaticProperties;
			DynamicBodyProperties dynamicBodyProperties = this.CharacterObject.GetBodyPropertiesMin(true).DynamicProperties;
			if (dynamicBodyProperties == DynamicBodyProperties.Invalid)
			{
				dynamicBodyProperties = DynamicBodyProperties.Default;
			}
			this.Weight = dynamicBodyProperties.Weight;
			this.Build = dynamicBodyProperties.Build;
			XmlAttribute xmlAttribute = node.Attributes["alive"];
			this._heroState = ((xmlAttribute != null && xmlAttribute.Value == "false") ? Hero.CharacterStates.Dead : Hero.CharacterStates.NotSpawned);
			if (this.IsDead)
			{
				HeroHelper.GetRandomDeathDayAndBirthDay((int)@object.Age, out this._birthDay, out this._deathDay);
			}
			this.CharacterObject.HeroObject = this;
			this.Father = (objectManager.ReadObjectReferenceFromXml("father", typeof(Hero), node) as Hero);
			this.Mother = (objectManager.ReadObjectReferenceFromXml("mother", typeof(Hero), node) as Hero);
			if (this.Spouse == null)
			{
				this.Spouse = (objectManager.ReadObjectReferenceFromXml("spouse", typeof(Hero), node) as Hero);
			}
			Clan clan = objectManager.ReadObjectReferenceFromXml("faction", typeof(Clan), node) as Clan;
			if (clan.StringId != "neutral")
			{
				this.Clan = clan;
			}
			this.EncyclopediaText = ((node.Attributes["text"] != null) ? new TextObject(node.Attributes["text"].Value, null) : TextObject.Empty);
			XmlNode xmlNode = node.Attributes["preferred_upgrade_formation"];
			this.PreferredUpgradeFormation = FormationClass.NumberOfAllFormations;
			FormationClass preferredUpgradeFormation;
			if (xmlNode != null && Enum.TryParse<FormationClass>(xmlNode.InnerText, true, out preferredUpgradeFormation))
			{
				this.PreferredUpgradeFormation = preferredUpgradeFormation;
			}
			ItemObject itemObject = (node.Attributes["banner_item"] != null) ? MBObjectManager.Instance.GetObject<ItemObject>(node.Attributes["banner_item"].Value) : null;
			if (itemObject != null)
			{
				this.BannerItem = new EquipmentElement(itemObject, null, null, false);
			}
			this.HeroDeveloper.InitializeHeroDeveloper(false, null);
		}

		// Token: 0x06000C34 RID: 3124 RVA: 0x0003F754 File Offset: 0x0003D954
		public bool CanLeadParty()
		{
			bool result = true;
			CampaignEventDispatcher.Instance.CanHeroLeadParty(this, ref result);
			return result;
		}

		// Token: 0x06000C35 RID: 3125 RVA: 0x0003F774 File Offset: 0x0003D974
		public static TextObject SetHeroEncyclopediaTextAndLinks(Hero o)
		{
			StringHelpers.SetCharacterProperties("LORD", o.CharacterObject, null, false);
			MBTextManager.SetTextVariable("TITLE", HeroHelper.GetTitleInIndefiniteCase(o), false);
			MBTextManager.SetTextVariable("REPUTATION", CharacterHelper.GetReputationDescription(o.CharacterObject), false);
			MBTextManager.SetTextVariable("FACTION_NAME", GameTexts.FindText("str_neutral_term_for_culture", o.MapFaction.IsMinorFaction ? o.Culture.StringId : o.MapFaction.Culture.StringId), false);
			if (o.MapFaction.Culture.StringId == "empire")
			{
				MBTextManager.SetTextVariable("FACTION_NAME", "{=empirefaction}Empire", false);
			}
			MBTextManager.SetTextVariable("CLAN_NAME", o.Clan.Name, false);
			if (o.Clan.IsMinorFaction || o.Clan.IsRebelClan)
			{
				if (o.Clan == Hero.MainHero.Clan)
				{
					MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=REWGj2ge}a rising new clan", false);
				}
				else if (o.Clan.IsSect)
				{
					MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=IlRC9Drl}a religious sect", false);
				}
				else if (o.Clan.IsClanTypeMercenary)
				{
					MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=5cH6ssDI}a mercenary company", false);
				}
				else if (o.Clan.IsNomad)
				{
					MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=nt1ra97u}a nomadic clan", false);
				}
				else if (o.Clan.IsMafia)
				{
					MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=EmBEupR5}a secret society", false);
				}
				else
				{
					MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=KZxKVby0}an organization", false);
				}
				if (o == Hero.MainHero && o.GetTraitLevel(DefaultTraits.Mercy) == 0 && o.GetTraitLevel(DefaultTraits.Honor) == 0 && o.GetTraitLevel(DefaultTraits.Generosity) == 0 && o.GetTraitLevel(DefaultTraits.Valor) == 0 && o.GetTraitLevel(DefaultTraits.Calculating) == 0)
				{
					return new TextObject("{=FHjM62IY}{LORD.FIRSTNAME} is a member of the {CLAN_NAME}, a rising new clan. {?LORD.GENDER}She{?}He{\\?} is still making {?LORD.GENDER}her{?}his{\\?} reputation.", null);
				}
				return new TextObject("{=9Obe3S6L}{LORD.FIRSTNAME} is a member of the {CLAN_NAME}, {CLAN_DESCRIPTION} from the lands of the {FACTION_NAME}. {?LORD.GENDER}She{?}He{\\?} has the reputation of being {REPUTATION}.", null);
			}
			else
			{
				List<Kingdom> list = (from x in Campaign.Current.Kingdoms
				where x.Culture == o.MapFaction.Culture
				select x).ToList<Kingdom>();
				if (list.Count > 1)
				{
					MBTextManager.SetTextVariable("RULER", o.MapFaction.Leader.Name, false);
				}
				MBTextManager.SetTextVariable("CLAN_DESCRIPTION", "{=KzSeg8ks}a noble family", false);
				if (list.Count == 1)
				{
					if (o.Clan.Leader == o)
					{
						return new TextObject("{=6d4ZTvGv}{LORD.NAME} is {TITLE} of the {FACTION_NAME} and head of the {CLAN_NAME}, {CLAN_DESCRIPTION} of the realm. {?LORD.GENDER}She{?}He{\\?} has the reputation of being {REPUTATION}.", null);
					}
					return new TextObject("{=o5AUljbW}{LORD.NAME} is a member of the {CLAN_NAME}, {CLAN_DESCRIPTION} of the {FACTION_NAME}. {?LORD.GENDER}She{?}He{\\?} has the reputation of being {REPUTATION}.", null);
				}
				else
				{
					if (list.Count <= 1)
					{
						return new TextObject("{=!}Placeholder text", null);
					}
					if (o.Clan.Leader == o)
					{
						return new TextObject("{=JuPUG5wX}{LORD.NAME} is {TITLE} of the {FACTION_NAME} and head of the {CLAN_NAME}, {CLAN_DESCRIPTION} that is backing {RULER} in the civil war. {?LORD.GENDER}She{?}He{\\?} has the reputation of being {REPUTATION}.", null);
					}
					return new TextObject("{=0bPb5btR}{LORD.NAME} is a member of the {CLAN_NAME}, {CLAN_DESCRIPTION} of the {FACTION_NAME} that is backing {RULER} in the civil war. {?LORD.GENDER}She{?}He{\\?} has the reputation of being {REPUTATION}.", null);
				}
			}
		}

		// Token: 0x06000C36 RID: 3126 RVA: 0x0003FABC File Offset: 0x0003DCBC
		public bool CanHeroEquipmentBeChanged()
		{
			bool result = true;
			CampaignEventDispatcher.Instance.CanHeroEquipmentBeChanged(this, ref result);
			return result;
		}

		// Token: 0x06000C37 RID: 3127 RVA: 0x0003FADC File Offset: 0x0003DCDC
		public bool CanMarry()
		{
			if (!Campaign.Current.Models.MarriageModel.IsSuitableForMarriage(this))
			{
				return false;
			}
			bool result = true;
			CampaignEventDispatcher.Instance.CanHeroMarry(this, ref result);
			return result;
		}

		// Token: 0x06000C38 RID: 3128 RVA: 0x0003FB14 File Offset: 0x0003DD14
		internal void OnDeath()
		{
			this.ClearAttributes();
			this._heroSkills = null;
			this._heroPerks = null;
			this._heroTraits = null;
			this._characterAttributes = null;
			this._heroDeveloper = null;
			this.VolunteerTypes = null;
			this._battleEquipment = null;
			this._civilianEquipment = null;
			this.SupporterOf = null;
			this.DeathMarkKillerHero = null;
			this.LastKnownClosestSettlement = null;
		}

		// Token: 0x06000C39 RID: 3129 RVA: 0x0003FB74 File Offset: 0x0003DD74
		private void SetPartyBelongedTo(MobileParty party)
		{
			if (this._partyBelongedTo != party && this._partyBelongedTo != null)
			{
				if (this._partyBelongedTo.LeaderHero == this)
				{
					this._partyBelongedTo.PartyComponent.ChangePartyLeader(null);
				}
				this._partyBelongedTo.RemoveHeroPerkRole(this);
			}
			this._partyBelongedTo = party;
		}

		// Token: 0x06000C3A RID: 3130 RVA: 0x0003FBC4 File Offset: 0x0003DDC4
		public bool CanBeGovernorOrHavePartyRole()
		{
			if (this.IsPrisoner)
			{
				return false;
			}
			bool result = true;
			CampaignEventDispatcher.Instance.CanBeGovernorOrHavePartyRole(this, ref result);
			return result;
		}

		// Token: 0x06000C3B RID: 3131 RVA: 0x0003FBEC File Offset: 0x0003DDEC
		public bool CanDie(KillCharacterAction.KillCharacterActionDetail causeOfDeath)
		{
			if (CampaignOptions.IsLifeDeathCycleDisabled && causeOfDeath == KillCharacterAction.KillCharacterActionDetail.DiedOfOldAge)
			{
				return false;
			}
			bool result = true;
			CampaignEventDispatcher.Instance.CanHeroDie(this, causeOfDeath, ref result);
			return result;
		}

		// Token: 0x06000C3C RID: 3132 RVA: 0x0003FC18 File Offset: 0x0003DE18
		public bool CanBecomePrisoner()
		{
			if (this != Hero.MainHero)
			{
				return true;
			}
			bool result = true;
			CampaignEventDispatcher.Instance.CanHeroBecomePrisoner(this, ref result);
			return result;
		}

		// Token: 0x06000C3D RID: 3133 RVA: 0x0003FC40 File Offset: 0x0003DE40
		public bool CanMoveToSettlement()
		{
			bool result = true;
			CampaignEventDispatcher.Instance.CanMoveToSettlement(this, ref result);
			return result;
		}

		// Token: 0x06000C3E RID: 3134 RVA: 0x0003FC60 File Offset: 0x0003DE60
		public bool CanHaveQuestsOrIssues()
		{
			if (this.Issue != null)
			{
				return false;
			}
			bool result = true;
			CampaignEventDispatcher.Instance.CanHaveQuestsOrIssues(this, ref result);
			return result;
		}

		// Token: 0x06000C3F RID: 3135 RVA: 0x0003FC88 File Offset: 0x0003DE88
		public string AssignVoice()
		{
			float age = this.CharacterObject.Age;
			this.GetTraitLevel(DefaultTraits.Mercy);
			int traitLevel = this.GetTraitLevel(DefaultTraits.Generosity);
			this.GetTraitLevel(DefaultTraits.Valor);
			int traitLevel2 = this.GetTraitLevel(DefaultTraits.Calculating);
			int traitLevel3 = this.GetTraitLevel(DefaultTraits.Honor);
			int traitLevel4 = this.GetTraitLevel(DefaultTraits.Politician);
			int traitLevel5 = this.GetTraitLevel(DefaultTraits.Commander);
			string str = null;
			if (!(this.CharacterObject.Culture.StringId == "empire"))
			{
				if (this.CharacterObject.Culture.StringId == "vlandia")
				{
					Clan clan = this.Clan;
					if ((clan != null && clan.IsNoble) || this.IsMerchant)
					{
						goto IL_BE;
					}
				}
				if (this.CharacterObject.Culture.StringId == "empire" || this.CharacterObject.Culture.StringId == "vlandia")
				{
					str = "lowerwest";
					goto IL_18E;
				}
				if (this.CharacterObject.Culture.StringId == "sturgia" || this.CharacterObject.Culture.StringId == "battania")
				{
					str = "north";
					goto IL_18E;
				}
				if (this.CharacterObject.Culture.StringId == "aserai" || this.CharacterObject.Culture.StringId == "khuzait")
				{
					str = "east";
					goto IL_18E;
				}
				goto IL_18E;
			}
			IL_BE:
			str = "upperwest";
			IL_18E:
			string str2 = "earnest";
			if (traitLevel4 < 3 && traitLevel < 0)
			{
				str2 = "curt";
			}
			else if (traitLevel4 < 3 && traitLevel5 < 5)
			{
				str2 = "softspoken";
			}
			else if (traitLevel2 - traitLevel3 > -1)
			{
				str2 = "ironic";
			}
			return str2 + "_" + str;
		}

		// Token: 0x06000C40 RID: 3136 RVA: 0x0003FE68 File Offset: 0x0003E068
		public void AddInfluenceWithKingdom(float additionalInfluence)
		{
			float randomFloat = MBRandom.RandomFloat;
			ChangeClanInfluenceAction.Apply(this.Clan, (float)((int)additionalInfluence + ((randomFloat < additionalInfluence - (float)MathF.Floor(additionalInfluence)) ? 1 : 0)));
		}

		// Token: 0x06000C41 RID: 3137 RVA: 0x0003FE9A File Offset: 0x0003E09A
		public float GetRelationWithPlayer()
		{
			return (float)Hero.MainHero.GetRelation(this);
		}

		// Token: 0x06000C42 RID: 3138 RVA: 0x0003FEA8 File Offset: 0x0003E0A8
		public float GetUnmodifiedClanLeaderRelationshipWithPlayer()
		{
			return (float)Hero.MainHero.GetBaseHeroRelation(this);
		}

		// Token: 0x06000C43 RID: 3139 RVA: 0x0003FEB8 File Offset: 0x0003E0B8
		public void SetTextVariables()
		{
			MBTextManager.SetTextVariable("SALUTATION_BY_PLAYER", (!CharacterObject.OneToOneConversationCharacter.IsFemale) ? GameTexts.FindText("str_my_lord", null) : GameTexts.FindText("str_my_lady", null), false);
			if (!TextObject.IsNullOrEmpty(this.FirstName))
			{
				MBTextManager.SetTextVariable("FIRST_NAME", this.FirstName, false);
			}
			else
			{
				MBTextManager.SetTextVariable("FIRST_NAME", this.Name, false);
			}
			MBTextManager.SetTextVariable("GENDER", this.IsFemale ? 1 : 0);
		}

		// Token: 0x06000C44 RID: 3140 RVA: 0x0003FF3B File Offset: 0x0003E13B
		public void SetPersonalRelation(Hero otherHero, int value)
		{
			value = MBMath.ClampInt(value, Campaign.Current.Models.DiplomacyModel.MinRelationLimit, Campaign.Current.Models.DiplomacyModel.MaxRelationLimit);
			CharacterRelationManager.SetHeroRelation(this, otherHero, value);
		}

		// Token: 0x06000C45 RID: 3141 RVA: 0x0003FF75 File Offset: 0x0003E175
		public int GetRelation(Hero otherHero)
		{
			if (otherHero == this)
			{
				return 0;
			}
			return Campaign.Current.Models.DiplomacyModel.GetEffectiveRelation(this, otherHero);
		}

		// Token: 0x06000C46 RID: 3142 RVA: 0x0003FF93 File Offset: 0x0003E193
		public int GetBaseHeroRelation(Hero otherHero)
		{
			return Campaign.Current.Models.DiplomacyModel.GetBaseRelation(this, otherHero);
		}

		// Token: 0x06000C47 RID: 3143 RVA: 0x0003FFAB File Offset: 0x0003E1AB
		public bool IsEnemy(Hero otherHero)
		{
			return CharacterRelationManager.GetHeroRelation(this, otherHero) < Campaign.Current.Models.DiplomacyModel.MinNeutralRelationLimit;
		}

		// Token: 0x06000C48 RID: 3144 RVA: 0x0003FFCA File Offset: 0x0003E1CA
		public bool IsFriend(Hero otherHero)
		{
			return CharacterRelationManager.GetHeroRelation(this, otherHero) > Campaign.Current.Models.DiplomacyModel.MaxNeutralRelationLimit;
		}

		// Token: 0x06000C49 RID: 3145 RVA: 0x0003FFE9 File Offset: 0x0003E1E9
		public bool IsNeutral(Hero otherHero)
		{
			return !this.IsFriend(otherHero) && !this.IsEnemy(otherHero);
		}

		// Token: 0x06000C4A RID: 3146 RVA: 0x00040000 File Offset: 0x0003E200
		public void ModifyHair(int hair, int beard, int tattoo)
		{
			BodyProperties bodyProperties = this.BodyProperties;
			FaceGen.SetHair(ref bodyProperties, hair, beard, tattoo);
			this.StaticBodyProperties = bodyProperties.StaticProperties;
		}

		// Token: 0x06000C4B RID: 3147 RVA: 0x0004002B File Offset: 0x0003E22B
		public void ModifyPlayersFamilyAppearance(StaticBodyProperties staticBodyProperties)
		{
			this.StaticBodyProperties = staticBodyProperties;
		}

		// Token: 0x170002FB RID: 763
		// (get) Token: 0x06000C4C RID: 3148 RVA: 0x00040034 File Offset: 0x0003E234
		public MBReadOnlyList<Workshop> OwnedWorkshops
		{
			get
			{
				return this._ownedWorkshops;
			}
		}

		// Token: 0x06000C4D RID: 3149 RVA: 0x0004003C File Offset: 0x0003E23C
		public void AddOwnedWorkshop(Workshop workshop)
		{
			if (!this._ownedWorkshops.Contains(workshop))
			{
				this._ownedWorkshops.Add(workshop);
			}
		}

		// Token: 0x06000C4E RID: 3150 RVA: 0x00040058 File Offset: 0x0003E258
		public void RemoveOwnedWorkshop(Workshop workshop)
		{
			if (this._ownedWorkshops.Contains(workshop))
			{
				this._ownedWorkshops.Remove(workshop);
			}
		}

		// Token: 0x06000C4F RID: 3151 RVA: 0x00040078 File Offset: 0x0003E278
		public static Hero FindFirst(Func<Hero, bool> predicate)
		{
			CharacterObject characterObject = Campaign.Current.Characters.FirstOrDefault((CharacterObject x) => x.IsHero && predicate(x.HeroObject));
			if (characterObject == null)
			{
				return null;
			}
			return characterObject.HeroObject;
		}

		// Token: 0x06000C50 RID: 3152 RVA: 0x000400B8 File Offset: 0x0003E2B8
		public static IEnumerable<Hero> FindAll(Func<Hero, bool> predicate)
		{
			return from x in Campaign.Current.Characters
			where x.IsHero && predicate(x.HeroObject)
			select x.HeroObject;
		}

		// Token: 0x170002FC RID: 764
		// (get) Token: 0x06000C51 RID: 3153 RVA: 0x00040111 File Offset: 0x0003E311
		public static MBReadOnlyList<Hero> AllAliveHeroes
		{
			get
			{
				return Campaign.Current.AliveHeroes;
			}
		}

		// Token: 0x170002FD RID: 765
		// (get) Token: 0x06000C52 RID: 3154 RVA: 0x0004011D File Offset: 0x0003E31D
		public static MBReadOnlyList<Hero> DeadOrDisabledHeroes
		{
			get
			{
				return Campaign.Current.DeadOrDisabledHeroes;
			}
		}

		// Token: 0x170002FE RID: 766
		// (get) Token: 0x06000C53 RID: 3155 RVA: 0x00040129 File Offset: 0x0003E329
		public static Hero MainHero
		{
			get
			{
				return CharacterObject.PlayerCharacter.HeroObject;
			}
		}

		// Token: 0x170002FF RID: 767
		// (get) Token: 0x06000C54 RID: 3156 RVA: 0x00040135 File Offset: 0x0003E335
		public static Hero OneToOneConversationHero
		{
			get
			{
				return Campaign.Current.ConversationManager.OneToOneConversationHero;
			}
		}

		// Token: 0x17000300 RID: 768
		// (get) Token: 0x06000C55 RID: 3157 RVA: 0x00040146 File Offset: 0x0003E346
		public static bool IsMainHeroIll
		{
			get
			{
				return Campaign.Current.MainHeroIllDays != -1;
			}
		}

		// Token: 0x06000C56 RID: 3158 RVA: 0x00040158 File Offset: 0x0003E358
		public void MakeWounded(Hero killerHero = null, KillCharacterAction.KillCharacterActionDetail deathMarkDetail = KillCharacterAction.KillCharacterActionDetail.None)
		{
			this.DeathMark = deathMarkDetail;
			this.DeathMarkKillerHero = killerHero;
			this.HitPoints = 1;
		}

		// Token: 0x06000C57 RID: 3159 RVA: 0x0004016F File Offset: 0x0003E36F
		public void AddDeathMark(Hero killerHero = null, KillCharacterAction.KillCharacterActionDetail deathMarkDetail = KillCharacterAction.KillCharacterActionDetail.None)
		{
			this.DeathMark = deathMarkDetail;
			this.DeathMarkKillerHero = killerHero;
		}

		// Token: 0x06000C58 RID: 3160 RVA: 0x0004017F File Offset: 0x0003E37F
		internal void OnAddedToParty(MobileParty mobileParty)
		{
			this.PartyBelongedTo = mobileParty;
			this.StayingInSettlement = null;
		}

		// Token: 0x06000C59 RID: 3161 RVA: 0x0004018F File Offset: 0x0003E38F
		internal void OnRemovedFromParty(MobileParty mobileParty)
		{
			this.PartyBelongedTo = null;
		}

		// Token: 0x06000C5A RID: 3162 RVA: 0x00040198 File Offset: 0x0003E398
		internal void OnAddedToPartyAsPrisoner(PartyBase party)
		{
			this.PartyBelongedToAsPrisoner = party;
			this.PartyBelongedTo = null;
		}

		// Token: 0x06000C5B RID: 3163 RVA: 0x000401A8 File Offset: 0x0003E3A8
		internal void OnRemovedFromPartyAsPrisoner(PartyBase party)
		{
			this.PartyBelongedToAsPrisoner = null;
		}

		// Token: 0x06000C5C RID: 3164 RVA: 0x000401B1 File Offset: 0x0003E3B1
		TextObject ITrackableBase.GetName()
		{
			return this.Name;
		}

		// Token: 0x06000C5D RID: 3165 RVA: 0x000401BC File Offset: 0x0003E3BC
		public Vec3 GetPosition()
		{
			Vec3 result = Vec3.Zero;
			if (this.CurrentSettlement != null)
			{
				result = this.CurrentSettlement.GetLogicalPosition();
			}
			else if (this.IsPrisoner && this.PartyBelongedToAsPrisoner != null)
			{
				result = (this.PartyBelongedToAsPrisoner.IsSettlement ? this.PartyBelongedToAsPrisoner.Settlement.GetLogicalPosition() : this.PartyBelongedToAsPrisoner.MobileParty.GetLogicalPosition());
			}
			else if (this.PartyBelongedTo != null)
			{
				result = this.PartyBelongedTo.GetLogicalPosition();
			}
			return result;
		}

		// Token: 0x06000C5E RID: 3166 RVA: 0x0004023C File Offset: 0x0003E43C
		public IMapPoint GetMapPoint()
		{
			if (this.CurrentSettlement != null)
			{
				return this.CurrentSettlement;
			}
			if (!this.IsPrisoner || this.PartyBelongedToAsPrisoner == null)
			{
				return this.PartyBelongedTo;
			}
			if (!this.PartyBelongedToAsPrisoner.IsSettlement)
			{
				return this.PartyBelongedToAsPrisoner.MobileParty;
			}
			return this.PartyBelongedToAsPrisoner.Settlement;
		}

		// Token: 0x06000C5F RID: 3167 RVA: 0x00040298 File Offset: 0x0003E498
		public float GetTrackDistanceToMainAgent()
		{
			return this.GetPosition().Distance(Hero.MainHero.GetPosition());
		}

		// Token: 0x06000C60 RID: 3168 RVA: 0x000402BD File Offset: 0x0003E4BD
		public bool CheckTracked(BasicCharacterObject basicCharacter)
		{
			return this.CharacterObject == basicCharacter;
		}

		// Token: 0x06000C61 RID: 3169 RVA: 0x000402C8 File Offset: 0x0003E4C8
		private void SetInitialValuesFromCharacter(CharacterObject characterObject)
		{
			foreach (SkillObject skill in Skills.All)
			{
				this.SetSkillValue(skill, characterObject.GetSkillValue(skill));
			}
			foreach (TraitObject trait in TraitObject.All)
			{
				this.SetTraitLevel(trait, characterObject.GetTraitLevel(trait));
			}
			this.Level = characterObject.Level;
			this.SetName(characterObject.Name, characterObject.Name);
			this.Culture = characterObject.Culture;
			this.HairTags = characterObject.HairTags;
			this.BeardTags = characterObject.BeardTags;
			this.TattooTags = characterObject.TattooTags;
			this._defaultAge = characterObject.Age;
			this._birthDay = HeroHelper.GetRandomBirthDayForAge(this._defaultAge);
			this.HitPoints = characterObject.MaxHitPoints();
			this.IsFemale = characterObject.IsFemale;
			this.Occupation = this.CharacterObject.GetDefaultOccupation();
			List<Equipment> list = (from t in characterObject.AllEquipments
			where !t.IsEmpty() && !t.IsCivilian
			select t).ToList<Equipment>();
			List<Equipment> list2 = (from t in characterObject.AllEquipments
			where !t.IsEmpty() && t.IsCivilian
			select t).ToList<Equipment>();
			if (list.IsEmpty<Equipment>())
			{
				CultureObject @object = Game.Current.ObjectManager.GetObject<CultureObject>("neutral_culture");
				list.AddRange(@object.DefaultBattleEquipmentRoster.AllEquipments);
			}
			if (list2.IsEmpty<Equipment>())
			{
				CultureObject object2 = Game.Current.ObjectManager.GetObject<CultureObject>("neutral_culture");
				list2.AddRange(object2.DefaultCivilianEquipmentRoster.AllEquipments);
			}
			if (!list.IsEmpty<Equipment>() && !list2.IsEmpty<Equipment>())
			{
				Equipment equipment = list[this.RandomInt(list.Count)];
				Equipment equipment2 = list2[this.RandomInt(list2.Count)];
				this._battleEquipment = equipment.Clone(false);
				this._civilianEquipment = equipment2.Clone(false);
			}
		}

		// Token: 0x06000C62 RID: 3170 RVA: 0x00040518 File Offset: 0x0003E718
		public void ResetEquipments()
		{
			this._battleEquipment = this.Template.FirstBattleEquipment.Clone(false);
			this._civilianEquipment = this.Template.FirstCivilianEquipment.Clone(false);
		}

		// Token: 0x06000C63 RID: 3171 RVA: 0x00040548 File Offset: 0x0003E748
		public void ChangeHeroGold(int changeAmount)
		{
			int gold;
			if (changeAmount > 2147483647 - this._gold)
			{
				gold = int.MaxValue;
			}
			else
			{
				gold = this._gold + changeAmount;
			}
			this.Gold = gold;
		}

		// Token: 0x06000C64 RID: 3172 RVA: 0x00040580 File Offset: 0x0003E780
		public void CheckInvalidEquipmentsAndReplaceIfNeeded()
		{
			for (int i = 0; i < 12; i++)
			{
				Equipment battleEquipment = this.BattleEquipment;
				if (((battleEquipment != null) ? battleEquipment[i].Item : null) == DefaultItems.Trash)
				{
					this.HandleInvalidItem(true, i);
				}
				else
				{
					Equipment battleEquipment2 = this.BattleEquipment;
					if (((battleEquipment2 != null) ? battleEquipment2[i].Item : null) != null)
					{
						if (!this.BattleEquipment[i].Item.IsReady)
						{
							if (MBObjectManager.Instance.GetObject(this.BattleEquipment[i].Item.Id) == this.BattleEquipment[i].Item)
							{
								MBObjectManager.Instance.UnregisterObject(this.BattleEquipment[i].Item);
							}
							this.HandleInvalidItem(true, i);
							MobileParty partyBelongedTo = this.PartyBelongedTo;
							if (partyBelongedTo != null)
							{
								partyBelongedTo.ItemRoster.AddToCounts(DefaultItems.Trash, 1);
							}
						}
						ItemModifier itemModifier = this.BattleEquipment[i].ItemModifier;
						if (itemModifier != null && !itemModifier.IsReady)
						{
							this.HandleInvalidModifier(true, i);
						}
					}
				}
				Equipment civilianEquipment = this.CivilianEquipment;
				if (((civilianEquipment != null) ? civilianEquipment[i].Item : null) == DefaultItems.Trash)
				{
					this.HandleInvalidItem(false, i);
				}
				else
				{
					Equipment civilianEquipment2 = this.CivilianEquipment;
					if (((civilianEquipment2 != null) ? civilianEquipment2[i].Item : null) != null)
					{
						if (!this.CivilianEquipment[i].Item.IsReady)
						{
							if (MBObjectManager.Instance.GetObject(this.CivilianEquipment[i].Item.Id) == this.CivilianEquipment[i].Item)
							{
								MBObjectManager.Instance.UnregisterObject(this.CivilianEquipment[i].Item);
							}
							this.HandleInvalidItem(false, i);
							MobileParty partyBelongedTo2 = this.PartyBelongedTo;
							if (partyBelongedTo2 != null)
							{
								partyBelongedTo2.ItemRoster.AddToCounts(DefaultItems.Trash, 1);
							}
						}
						ItemModifier itemModifier2 = this.CivilianEquipment[i].ItemModifier;
						if (itemModifier2 != null && !itemModifier2.IsReady)
						{
							this.HandleInvalidModifier(false, i);
						}
					}
				}
			}
		}

		// Token: 0x06000C65 RID: 3173 RVA: 0x000407C8 File Offset: 0x0003E9C8
		private void HandleInvalidItem(bool isBattleEquipment, int i)
		{
			if (this.IsHumanPlayerCharacter)
			{
				if (isBattleEquipment)
				{
					this.BattleEquipment[i] = EquipmentElement.Invalid;
					return;
				}
				this.CivilianEquipment[i] = EquipmentElement.Invalid;
				return;
			}
			else
			{
				List<Equipment> list;
				if (!isBattleEquipment)
				{
					list = (from t in this.CharacterObject.CivilianEquipments
					where !t.IsEmpty()
					select t).ToList<Equipment>();
				}
				else
				{
					list = (from t in this.CharacterObject.BattleEquipments
					where !t.IsEmpty()
					select t).ToList<Equipment>();
				}
				List<Equipment> list2 = list;
				EquipmentElement value = list2[this.RandomInt(list2.Count)][i];
				if (value.IsEmpty || !value.Item.IsReady)
				{
					value = EquipmentElement.Invalid;
				}
				if (!isBattleEquipment)
				{
					EquipmentElement equipmentElement = this.CivilianEquipment[i];
				}
				else
				{
					EquipmentElement equipmentElement2 = this.BattleEquipment[i];
				}
				if (isBattleEquipment)
				{
					this.BattleEquipment[i] = value;
					return;
				}
				this.CivilianEquipment[i] = value;
				return;
			}
		}

		// Token: 0x06000C66 RID: 3174 RVA: 0x000408E8 File Offset: 0x0003EAE8
		private void HandleInvalidModifier(bool isBattleEquipment, int i)
		{
			if (isBattleEquipment)
			{
				this.BattleEquipment[i] = new EquipmentElement(this.BattleEquipment[i].Item, null, null, false);
				return;
			}
			this.CivilianEquipment[i] = new EquipmentElement(this.CivilianEquipment[i].Item, null, null, false);
		}

		// Token: 0x06000C67 RID: 3175 RVA: 0x00040949 File Offset: 0x0003EB49
		internal void ResetClanForOldSave()
		{
			this._clan = null;
		}

		// Token: 0x0400035F RID: 863
		[SaveableField(120)]
		public int LastTimeStampForActivity;

		// Token: 0x04000360 RID: 864
		public const int MaximumNumberOfVolunteers = 6;

		// Token: 0x04000361 RID: 865
		[SaveableField(130)]
		public CharacterObject[] VolunteerTypes;

		// Token: 0x04000362 RID: 866
		[SaveableField(160)]
		private float _passedTimeAtHomeSettlement;

		// Token: 0x04000363 RID: 867
		[SaveableField(170)]
		private CharacterObject _characterObject;

		// Token: 0x04000364 RID: 868
		[SaveableField(180)]
		private TextObject _firstName;

		// Token: 0x04000365 RID: 869
		[SaveableField(181)]
		private TextObject _name;

		// Token: 0x04000368 RID: 872
		[SaveableField(201)]
		public string HairTags = "";

		// Token: 0x04000369 RID: 873
		[SaveableField(202)]
		public string BeardTags = "";

		// Token: 0x0400036A RID: 874
		[SaveableField(203)]
		public string TattooTags = "";

		// Token: 0x0400036F RID: 879
		[SaveableField(260)]
		private Hero.CharacterStates _heroState;

		// Token: 0x04000370 RID: 880
		[SaveableField(270)]
		private CharacterTraits _heroTraits;

		// Token: 0x04000371 RID: 881
		[SaveableField(280)]
		private CharacterPerks _heroPerks;

		// Token: 0x04000372 RID: 882
		[SaveableField(290)]
		private CharacterSkills _heroSkills;

		// Token: 0x04000373 RID: 883
		[SaveableField(301)]
		private CharacterAttributes _characterAttributes;

		// Token: 0x04000374 RID: 884
		internal bool IsNobleForOldSaves;

		// Token: 0x04000376 RID: 886
		[SaveableField(370)]
		public int Level;

		// Token: 0x04000378 RID: 888
		public const int HeroWoundedHealthLevel = 20;

		// Token: 0x04000379 RID: 889
		[SaveableField(380)]
		private Clan _companionOf;

		// Token: 0x0400037E RID: 894
		[SaveableField(420)]
		public int SpcDaysInLocation;

		// Token: 0x0400037F RID: 895
		[SaveableField(430)]
		private int _health;

		// Token: 0x04000380 RID: 896
		[SaveableField(441)]
		private float _defaultAge;

		// Token: 0x04000381 RID: 897
		[SaveableField(440)]
		private CampaignTime _birthDay;

		// Token: 0x04000382 RID: 898
		[SaveableField(450)]
		private CampaignTime _deathDay;

		// Token: 0x04000383 RID: 899
		[SaveableField(460)]
		private float _power;

		// Token: 0x04000385 RID: 901
		[SaveableField(500)]
		private Clan _clan;

		// Token: 0x04000386 RID: 902
		[SaveableField(510)]
		private Clan _supporterOf;

		// Token: 0x04000387 RID: 903
		[SaveableField(520)]
		private Town _governorOf;

		// Token: 0x04000388 RID: 904
		[SaveableField(530)]
		private MBList<Workshop> _ownedWorkshops = new MBList<Workshop>();

		// Token: 0x0400038A RID: 906
		[SaveableField(551)]
		public CultureObject Culture;

		// Token: 0x0400038C RID: 908
		[XmlIgnore]
		[SaveableField(560)]
		private MobileParty _partyBelongedTo;

		// Token: 0x0400038E RID: 910
		[SaveableField(580)]
		private Settlement _stayingInSettlement;

		// Token: 0x0400038F RID: 911
		[SaveableField(590)]
		public MBList<ItemObject> SpecialItems;

		// Token: 0x04000390 RID: 912
		[SaveableField(412)]
		private bool _isKnownToPlayer;

		// Token: 0x04000391 RID: 913
		[SaveableField(610)]
		private bool _hasMet;

		// Token: 0x04000393 RID: 915
		[SaveableField(630)]
		private Settlement _bornSettlement;

		// Token: 0x04000394 RID: 916
		[CachedData]
		private Settlement _homeSettlement;

		// Token: 0x04000395 RID: 917
		[SaveableField(650)]
		private int _gold;

		// Token: 0x04000397 RID: 919
		[SaveableField(700)]
		private Hero _father;

		// Token: 0x04000398 RID: 920
		[SaveableField(710)]
		private Hero _mother;

		// Token: 0x04000399 RID: 921
		[SaveableField(720)]
		private readonly MBList<Hero> _exSpouses;

		// Token: 0x0400039A RID: 922
		[SaveableField(730)]
		private Hero _spouse;

		// Token: 0x0400039B RID: 923
		[SaveableField(740)]
		private readonly MBList<Hero> _children = new MBList<Hero>();

		// Token: 0x0400039C RID: 924
		[SaveableField(760)]
		public bool IsPregnant;

		// Token: 0x0400039D RID: 925
		[SaveableField(770)]
		private IHeroDeveloper _heroDeveloper;

		// Token: 0x020004AB RID: 1195
		public enum CharacterStates
		{
			// Token: 0x0400142E RID: 5166
			NotSpawned,
			// Token: 0x0400142F RID: 5167
			Active,
			// Token: 0x04001430 RID: 5168
			Fugitive,
			// Token: 0x04001431 RID: 5169
			Prisoner,
			// Token: 0x04001432 RID: 5170
			Released,
			// Token: 0x04001433 RID: 5171
			Dead,
			// Token: 0x04001434 RID: 5172
			Disabled,
			// Token: 0x04001435 RID: 5173
			Traveling
		}
	}
}
